Slim Dependencies
Created by: wtgtybhertgeghgtwtg
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.
-
Currently, three versions of acornare used.4.0.3(560 KB), used byespree,3.3.0(520 KB), used byacorn-jsxandwebpack, and2.7.04.0.8(560 KB), used byacorn-globalsandjsdom.-
If #183 (closed) happens, the version of webpackrequired will require the same version ofacornthatespreeuses. -
An issue has been raised for acorn-jsxto bump their required version ofacorn, but there has been no response. -
The latest release of acorn-globalsrequires the same version ofacornthatwebpackandacorn-jsxrequire, butjsdomuses an older version. -
An issue has been raised for espreeto bump their required version ofacorn.
-
-
The version of recursive-readdirrequired 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, butyarnseems to putminimatch@3.0.2in the basenode_modulesfolder while placingminimatch@3.0.3in thenode_modulesfolders 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 #1560. -
browserify-zlibpackages ~110 KB of tests. A PR has been filed. -
escopedepends ones6-mapandes6-weak-map. These two packages, along with their dependantsd,es5-ext,es6-iterator,es6-set, andes6-symbol, andevent-emittertake up ~560 KB. An issue has been filed on this, butescopedoes not seem to be actively maintained. It seemseslintwill forkhas forkedescopefor the next version, which does not contain the polyfills. -
istanbul-reportspackages a.nyc_outputfolder of ~310 KB. A PR has been filed. -
jsx-ast-utilspackages ayarn.lockof ~110 KB. An issue has been filed. -
The version of node-notifiercurrently used byjestrequired includes a CLI that is not used and depends on a framework that is not used elsewhere inreact-scripts. https://github.com/facebook/jest/pull/2718, which is included injest@19.0.0, resolved this.