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 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
.-
If #183 (closed) happens, the version of webpack
required will require the same version ofacorn
thatespree
uses. -
An issue has been raised for acorn-jsx
to bump their required version ofacorn
, but there has been no response. -
The latest release of acorn-globals
requires the same version ofacorn
thatwebpack
andacorn-jsx
require, butjsdom
uses an older version. -
An issue has been raised for espree
to bump their required version ofacorn
.
-
-
The version of 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 #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. -
The version of 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
. https://github.com/facebook/jest/pull/2718, which is included injest@19.0.0
, resolved this.