You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`v8-compile-cache` is not loading because `fs.existsSync` is checking for a file that doesn't exist. `fs.existsSync` resolves relative to the cwd, not the current module (like `require`), and `v8CompileCachePath`'s filename is missing `.js`.
Instead of checking for the existence of `v8-compile-cache.js`, just try to `require` it in a `try`/`catch`, using a full path. Also switched the `require` of `cli.js` to use the same pattern for consistency (plus it's a module resolution micro-optimization).
```
# before
$ time ./dist/bin/yarn -v
1.10.0-0
./dist/bin/yarn -v 0.28s user 0.06s system 98% cpu 0.344 total
# after
$ time ./dist/bin/yarn -v
1.10.0-0
./dist/bin/yarn -v 0.16s user 0.05s system 97% cpu 0.213 total
```
0 commit comments