We have a simple app showing a map that uses es modules and Vite for building (we do not set assetsPath). When we do a "npm run build" we end up with almost 300 files from the arcgis api for js in our dist/assets folder.
When running the built app we can see that some of those 300 files are imported and used, but far from all of them. For instance the assets folder includes files for WMTSLayer, although we do not use WMTS layers in our app.
Why are there files included in the build that apparently are not used by the app? Why are the files not being bundled?