Hello all I’m using npm, webpack and es6 modules to create an app.js that will be shipped to the client. Everything’s working fine, except for the app.js file size. It is massive - 10 MB minified .
A look at the stats reveals that the largest contributors are inspector and guieditor.
I import the inspector only when I’m in development mode in my app.js. Is there any way to pinpoint which line of code in my project is causing these 2 massive libraries to get loaded?
Hard to say without seeing all your imports and webpack configs, but what happens if you comment out that import line all together? My hunch is that there’s some other place in your imports where you’re bringing it in? (assuming you don’t see that console log in prod?)
Btw, b/c of the massive amount of time it adds to the build process, i just started to load the inspector in from html instead of including in the build - and then comment out those lines when pushing to prod.
What is your production command look like in package.json? Are you sure it sets NODE_ENV environment variable to production? Otherwise your config look good to me. I have something similar works in my project.