Hello,
I have spun up a Create React Application and any time I import a single module from arcgis/core e.g:
import Graphic from '@arcgis/core/Graphic'
my build process runs out of memory.
I have also tried building the sample React app here:
https://github.com/Esri/jsapi-resources/tree/master/esm-samples/jsapi-create-react-app
and am getting the same issue.
I think it has something to do with Tree Shaking: https://webpack.js.org/guides/tree-shaking/
I'm pretty sure that by importing a single module it imports the entire arcgis/core dependency. I don't know if I'm not importing the modules correctly or if it isn't possible to import just the modules I need.
Is there something that I'm missing?
Thank you
Hi,
Same for me, I'm not able to build my project anymore. Though I've sucessfully built https://github.com/Esri/jsapi-resources/tree/master/esm-samples/jsapi-create-react-app, I get around 250 js chunks with this sample... Using esri_loader I had around 5 chunks.
Yeah I had to use esri-loader. I wonder if this has been fixed in the latest version of @arcgis/core
Any updates about this one?
Any updates? Having a similar issue. I am building a component as part of a library, and that always ends up with 300 chunks, Ideally I would pack them straight into the single exported js file.
I'm having the same problem. I tried to use esri-loader instead, as @avecchi said they've been using that instead, but I couldn't get it to work.
The only (temprary) fix I could find was increasing the memory usage through NODE_OPTIONS (with --max-old-space-size)