I'm currently using `@arcgis/core` for my React application but I'm running into long build times due to something with how webpack is code splitting the `@arcgis/core` code. I'm seeing now that there is another library called `arcgis-js-api` and I'm wondering what the difference between the two is since they both look like they're doing the same thing.
Solved! Go to Solution.
@AndyGupSo as I understand it the @arcgis/core copies all assets at build? I used CRA to display a globe and my build is over 1GB.
Is this the correct functionality of @arcgis/core? Will esri-loader give me smaller builds?
@JamesBrett Nope, that doesn't sound right. Can you provide a simple github repo that we can look at? Here are our sample app build sizes for comparison: https://github.com/Esri/jsapi-resources/blob/master/esm-samples/.metrics/4.23.0.csv
Correct, we measure a variety of stats including the size of the entire build folder for each of the samples. A 1GB folder could the the result of things like configuration issues, third party libraries, a very large and complex application, lots of image files, etc.
Maybe try updating via `npm i '@ArcGIS/core@next`. Starting at 4.19 (coming out later this month) there's no asset copying by default (unless you need the assets locally). Here's our working sample for 4.18: https://github.com/Esri/jsapi-resources/tree/master/esm-samples/jsapi-create-react-app
I see. Not copying the assets on 4.19 is working but I'm still having my issue with my production build.
My main issue is that whenever I import a single module from @Anonymous User/core e.g:
import Graphic from '@arcgis/core/Graphic'
My webpack production build process runs out of memory.