-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Slim Dependencies #1183
Comments
Amazing investigation, thank you. |
Another thing that might help would be trying
Assuming this isn't just a program with my machine, I think you can run |
And I don't know why I'm just now noticing this, but since the version of |
Also interesting: apparently installed size is larger with Yarn? https://twitter.com/petrhurtak/status/812356423795568640 |
I think that's because of how You can see this by going to the |
Can confirm that yarn size is between 20-50% larger and the same % increase in total number of files due to the structure under yarn. |
Instead of react-scripts I used react-scripts-ts, node_modules folder was 137MB instead of 561MB |
yarnpkg/yarn#2306 should help with that, once implemented! |
This is likely because you have Yarn installed, and Yarn has a bug. |
|
Somewhat related, I was a bit alarmed at my first run of I was looking for a light-weight way to get up and running with react, ideally to spin up a handful of hello-world apps locally for running through tutorials, etc. Over half a gig does discourage creating a number of quick little prototypes. I'm new to the react world though, so perhaps there is a good resource for doing this! |
This is a different issue and caused by Yarn bug: #1397. We'll work around it in 0.9.0. |
Indeed it is! Nuked the 131MB is a lot easier to swallow than 556MB. |
This is why you should be careful adopting new tech 😉 |
|
You can take a high-level view here: http://pkgsize.com/react-scripts.html
... and they all include a whole bunch of |
I wonder how this compares to master since we switched to webpack 2 and might have new regressions (or it might be better). We should cut a canary release. |
FWIW a PR has been filed for |
It's gonna be there anyway, since |
I'll close this as stale. (But efforts to further dedupe are welcome!) |
Based on a previous discussion.
This is a short list of some of what can be done to reduce some of the larger items that increase the overall size of
react-scripts
. Excluded are smaller, opinionated, or rejected fixes.acorn
are used.4.0.3
(560 KB), used byespree
,3.3.0
(520 KB), used byacorn-jsx
andwebpack
, and2.7.0
4.0.8
(560 KB), used byacorn-globals
andjsdom
.webpack
required will require the same version ofacorn
thatespree
uses.acorn-jsx
to bump their required version ofacorn
, but there has been no response.acorn-globals
requires the same version ofacorn
thatwebpack
andacorn-jsx
require, butjsdom
uses an older version.espree
to bump their required version ofacorn
.recursive-readdir
required specifically requires"minimatch": "3.0.2"
, preventing it from deduping with the"minimatch": ">= 3.0.3"
ineslint-plugin-import
. Which normally wouldn't be that much of a problem, butyarn
seems to putminimatch@3.0.2
in the basenode_modules
folder while placingminimatch@3.0.3
in thenode_modules
folders ofbabel-core
,eslint-plugin-import
,glob
,fstream-ignore
,multimatch
,readdirp
, andsane
, meaning the same version of a ~30 KB dependency is copied six times over. Fixed with Bumprecursive-readdir
. #1560.browserify-zlib
packages ~110 KB of tests. A PR has been filed.escope
depends ones6-map
andes6-weak-map
. These two packages, along with their dependantsd
,es5-ext
,es6-iterator
,es6-set
, andes6-symbol
, andevent-emitter
take up ~560 KB. An issue has been filed on this, butescope
does not seem to be actively maintained. It seemseslint
will forkhas forkedescope
for the next version, which does not contain the polyfills.istanbul-reports
packages a.nyc_output
folder of ~310 KB. A PR has been filed.jsx-ast-utils
packages ayarn.lock
of ~110 KB. An issue has been filed.node-notifier
currently used byjest
required includes a CLI that is not used and depends on a framework that is not used elsewhere inreact-scripts
. Updates node-notifier dep of jest-cli to v5 jestjs/jest#2718, which is included injest@19.0.0
, resolved this.The text was updated successfully, but these errors were encountered: