Closed wgoodall01 closed 7 years ago
Implemented your changes --
For each set of modules, after they are fetched with yarn
, a cache key is generated from the names and exact versions -- this is then used to store the sizes with the conf
module.
Thanks for the PR, released in v1.5.0
(Fixes issue #1)
This PR implements caching for the module sizes. Every time
getSizes()
is run and calculates the size of a bundle, it will write the size information to a JSON file located whereverpackage-size
is installed. Then, for subsequent runs ofgetSizes()
, the cached values will be read from disk and used instead of rebuilding the package. To disable the cache and force a module to be rebuilt, pass--no-cache
to the CLI or{cache:false}
in theoptions
obj. To clear the cache, runpackage-size clear-cache
.