Created by: arcanis
When running create-react-app
, a good chunk of the time is spent resolving the dependency tree to satisfying versions. Since react-scripts
uses pinned dependencies anyway (suggesting that you always want to use precise versions), this looks a bit unnecessary.
This PR adds a new script, compile:lockfile
, meant to be ran manually every now and then. It will update the yarn.lock.cached
file located in the create-react-app
package, which will be copied into the app directory before running yarn add react-scripts
(only if Yarn is being used, of course). Three cases then:
- If
create-react-app
is up-to-date with the latestreact-scripts
, the resolution will be mostly instantaneous. - If
create-react-app
is completely desynchronized with thereact-scripts
being used, the resolution will be like now (the cached resolution will simply be ignored by Yarn). - If
create-react-app
is old-but-not-that-much compared toreact-scripts
, Yarn will be able to reuse at least some of the cached resolution, which will still give a perf boost.