-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Support "register" tools in module loader #9285
Support "register" tools in module loader #9285
Conversation
Hmm.. I wonder what happened there.. maybe it's the Atlassian package registry. I'll have a look. EDIT Fixed it.. for some reason I accidentally used |
Benchmark ResultsKitchen Sink ✅
Timings
Cold Bundles
Cached Bundles
React HackerNews ✅
Timings
Cold Bundles
Cached BundlesNo bundle changes detected. AtlasKit Editor ✅
Timings
Cold Bundles
Cached Bundles
Three.js ✅
Timings
Cold BundlesNo bundle changes detected. Cached BundlesNo bundle changes detected. |
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.
Amazing test case 🤌
↪️ Pull Request
This change modifies the
NodePackageManager
to support loading modules when using tools likeesbuild-register
orts-node
.Essentially these tools work by modifying
Module._extensions
to add handlers for additional extensions (like.ts
). We now pass this extension list to the resolver instance we create inNodePackageManager
, and whenever we create a new Module we check whether the list of extensions has been amended.This means that when using tools like
ts-node
oresbuild-register
, Parcel plugins can be written in TypeScript.🚨 Test instructions
Added a new integration test which uses a reporter written in TS, and
esbuild-register
.I considered adding an integration test using
ts-node
, but I did a manual check and verified it also works, and it's pretty much the same asesbuild-register
in terms of mechanics so didn't think it was worth the extra dependency.✔️ PR Todo