Alright. I ran the numbers myself.
C:\Users\Derk-Jan\Exercism\typescript\hello-world>yarn set version stable
β€ YN0000: Retrieving https://repo.yarnpkg.com/3.4.1/packages/yarnpkg-cli/bin/yarn.js
β€ YN0000: Saving the new release in .yarn/releases/yarn-3.4.1.cjs
β€ YN0000: Done in 0s 420ms
C:\Users\Derk-Jan\Exercism\typescript\hello-world>yarn
β€ YN0000: β Resolution step
β€ YN0032: β fsevents@npm:2.3.2: Implicit dependencies on node-gyp are discouraged
β€ YN0061: β w3c-hr-time@npm:1.0.2 is deprecated: Use your platform's native performance.now() and performance.timeOrigin.
β€ YN0061: β @npmcli/move-file@npm:2.0.1 is deprecated: This functionality has been moved to @npmcli/fs
β€ YN0000: β Completed in 4s 663ms
β€ YN0000: β Fetch step
β€ YN0013: β y18n@npm:5.0.8 can't be found in the cache and will be fetched from the remote registry
β€ YN0013: β yallist@npm:3.1.1 can't be found in the cache and will be fetched from the remote registry
β€ YN0013: β yallist@npm:4.0.0 can't be found in the cache and will be fetched from the remote registry
β€ YN0013: β yargs-parser@npm:20.2.9 can't be found in the cache and will be fetched from the remote registry
β€ YN0013: β yargs@npm:16.2.0 can't be found in the cache and will be fetched from the remote registry
β€ YN0000: β Completed in 1s 390ms
β€ YN0000: β Link step
β€ YN0000: β ESM support for PnP uses the experimental loader API and is therefore experimental
β€ YN0007: β core-js@npm:3.28.0 must be built because it never has been before or the last one failed
β€ YN0000: β Completed in 3s 325ms
β€ YN0000: Done with warnings in 9s 440ms
C:\Users\Derk-Jan\Exercism\typescript\hello-world>
9s to completion.
The second exercise:
C:\Users\Derk-Jan\Exercism\typescript\two-fer>yarn set version stable
β€ YN0000: Retrieving https://repo.yarnpkg.com/3.4.1/packages/yarnpkg-cli/bin/yarn.js
β€ YN0000: Saving the new release in .yarn/releases/yarn-3.4.1.cjs
β€ YN0000: Done in 0s 408ms
C:\Users\Derk-Jan\Exercism\typescript\two-fer>yarn
β€ YN0000: β Resolution step
β€ YN0032: β fsevents@npm:2.3.2: Implicit dependencies on node-gyp are discouraged
β€ YN0061: β w3c-hr-time@npm:1.0.2 is deprecated: Use your platform's native performance.now() and performance.timeOrigin.
β€ YN0061: β @npmcli/move-file@npm:2.0.1 is deprecated: This functionality has been moved to @npmcli/fs
β€ YN0000: β Completed in 4s 100ms
β€ YN0000: β Fetch step
β€ YN0013: β y18n@npm:5.0.8 can't be found in the cache and will be fetched from the remote registry
β€ YN0013: β yallist@npm:3.1.1 can't be found in the cache and will be fetched from the remote registry
β€ YN0013: β yallist@npm:4.0.0 can't be found in the cache and will be fetched from the remote registry
β€ YN0013: β yargs-parser@npm:20.2.9 can't be found in the cache and will be fetched from the remote registry
β€ YN0013: β yargs@npm:16.2.0 can't be found in the cache and will be fetched from the remote registry
β€ YN0000: β Completed in 0s 666ms
β€ YN0000: β Link step
β€ YN0000: β ESM support for PnP uses the experimental loader API and is therefore experimental
β€ YN0007: β core-js@npm:3.28.0 must be built because it never has been before or the last one failed
β€ YN0000: β Completed in 4s 228ms
β€ YN0000: Done with warnings in 9s 77ms
9s to completion.
In both cases, both have a local cache folder of about 40 MB.
Can we get rid of that folder? Why yes we can. The local folder allows for zero installs, but this is also available globally. Letβs first remove the cache in both folders:
yarn cache clean
Now add enableGlobalCache: true
to the .yarnrc.yml
and install.
C:\Users\Derk-Jan\Exercism\typescript\hello-world>yarn install
β€ YN0000: β Resolution step
β€ YN0000: β Completed
β€ YN0000: β Fetch step
β€ YN0013: β y18n@npm:5.0.8 can't be found in the cache and will be fetched from the remote registry
β€ YN0013: β yallist@npm:3.1.1 can't be found in the cache and will be fetched from the remote registry
β€ YN0013: β yallist@npm:4.0.0 can't be found in the cache and will be fetched from the remote registry
β€ YN0013: β yargs-parser@npm:20.2.9 can't be found in the cache and will be fetched from the remote registry
β€ YN0013: β yargs@npm:16.2.0 can't be found in the cache and will be fetched from the remote registry
β€ YN0000: β Completed in 21s 975ms
β€ YN0000: β Link step
β€ YN0000: β ESM support for PnP uses the experimental loader API and is therefore experimental
β€ YN0000: β Completed
β€ YN0000: Done with warnings in 22s 159ms
Oof. 9s went to 22s (which imo is fine), but this happened because we just killed the cache, which purges all files.
Letβs also delete two-fer/.yarn
(manually), and delete .yarnrc.yml
.
Now we start again:
yarn set version stable
Add enableGlobalCache: true
,
yarn install
And the results:
$ yarn set version stable
β€ YN0000: Retrieving https://repo.yarnpkg.com/3.4.1/packages/yarnpkg-cli/bin/yarn.js
β€ YN0000: Saving the new release in .yarn/releases/yarn-3.4.1.cjs
β€ YN0000: Done in 0s 445ms
$ yarn install
β€ YN0000: β Resolution step
β€ YN0000: β Completed
β€ YN0000: β Fetch step
β€ YN0000: β Completed in 0s 307ms
β€ YN0000: β Link step
β€ YN0000: β ESM support for PnP uses the experimental loader API and is therefore experimental
β€ YN0007: β core-js@npm:3.28.0 must be built because it never has been before or the last one failed
β€ YN0000: β Completed in 2s 37ms
β€ YN0000: Done with warnings in 2s 494ms
Done in 2.5 seconds, with zero packages fetched.
The .yarn folder size is now ~6 MB.
I donβt know if this was your goal, but this is about as small as itβs going to get.