-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sheer size #3508
Comments
Since documentation is at the top of that list, I did some research and the result is... puzzling: documentationjs/documentation#583 - npm installs the core-js module for every single babel transform. 84% of the install is duplicate core-js modules. That's assuming npm v2.x. yarn, on the other hand, installs documentation in 46MB, instead of 372MB of space. Likewise, with mapbox-gl-js
The conclusion here is that, for large projects, it's looking like npm v2 is insufficient and we all need to switch to yarn or npm v3. |
Yes, this is unfortunately an issue with NPM2 and the way it duplicates dependencies. It leads to huge sizes in any projects that use Babel, which is broken down into tons of tiny reused modules. There's nothing we can do about that on GL JS side, so I have to close the issue. For Headless GL size, I filed stackgl/headless-gl#83 earlier. |
@tmcw @mourner Should have added that I'm on [email protected], I'll give yarn a go, though. Woah, yarn's night and day coming in at 42meg total. |
@gaving wait, I thought you were talking about |
@mourner This is just adding mapbox-gl dependency to a project, so not within a mapbox-gl-js folder. Isn't the default of npm install to install dev dependencies? Edit: Looks like there's an |
@gaving no, the flags are for running |
@mourner Seems that isn't the case anymore with npm@3, check out: https://docs.npmjs.com/misc/config#production
|
Or maybe that just applies without specifying a package name as you've already said, I'm so confused. All I know is what is happening in my original report, I don't think I've any weird configuration going on unless my npm is busted somehow. |
¯_(ツ)_/¯ NPM3 is very buggy, no idea what triggers this for you. I'd recommend trying out Yarn. It hasn't matured yet, but it's already better than NPM in every way. |
Yeah I'll stick with yarn, I'll follow-up if I manage to work out what the deal is with npm. Cheers! |
@mourner Ah good to hear, I glanced over that other related/closed issue actually but didn't see the relevance due to the shrinkwrap mention. Glad there isn't something mental with my setup! |
Should this work as expected now on the latest version of npm? It's is still giving me headaches even on the latest version (I can't use yarn at work due to other issues). I've stuck a minimum Dockerfile reproducing the issue here:- https://gist.github.com/gaving/eae05782b9bd5e791e320c26a7e9788e As you can see, still a ginormous 700meg build. |
mapbox-gl-js 0.26:
Am I missing something, or should a
npm install mapbox-gl
in a directory result in a ~1 gig node_modules folder and ~5 minute install?Steps to Trigger Behavior
npm install mapbox-gl
Expected Behavior
Reasonably quick npm install, sensible size.
Actual Behavior
Gives my relatively recent MacBook a heart attack, fan slams on and unibody becomes a 80 degree heatsink.
ncdu on node_modules shows the bulk of it under the documentation/gl folders.
The text was updated successfully, but these errors were encountered: