-
Notifications
You must be signed in to change notification settings - Fork 604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[heft] Add options to only resolve symlinks that are within node_modules #5011
[heft] Add options to only resolve symlinks that are within node_modules #5011
Conversation
common/changes/@rushstack/real-node-module-path/fast-realpath_2024-11-20-03-42.json
Outdated
Show resolved
Hide resolved
heft-plugins/heft-jest-plugin/src/exports/jest-node-modules-symlink-resolver.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this also an issue that Webpack would need a resolver for?
common/changes/@rushstack/real-node-module-path/fast-realpath_2024-11-20-03-42.json
Outdated
Show resolved
Hide resolved
For webpack I'd rather use |
5f2cacd
to
dee68ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks generally good, a couple comments
dee68ad
to
99caf58
Compare
Summary
TypeScript and Jest spend a lot of CPU cycles invoking
realpath
on inputs that don't contain any symbolic links. This PR adds a new package@rushstack/real-node-module-path
that has similar semantics torealpath
, but only performs file system calls if the path is undernode_modules
.Details
Adds an option
onlyResolveSymlinksInNodeModules
toconfig/typescript.json
that will replace the builtinrealpath
with the new package to accelerate initial file system crawling.Adds a custom resolver
@rushstack/heft-jest-plugin/lib/exports/jest-node-modules-symlink-resolver.js
that replaces therealpathSync
method within Jest's default resolver with the new package.How it was tested
Unit tests for the behavior of the function.
Invoked from TypeScript and Jest in heft-webpack5-everything-test.
Enabled both options in local-node-rig so that projects in rushstack build with them.
Impacted documentation
Readmes, schema for typescript.json.