-
-
Notifications
You must be signed in to change notification settings - Fork 534
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
fix: Alias --es-module-specifier-resolution to --experimental-specifier-resolution for Node 12 compatibility #1122
Conversation
…er-resolution for node 12 compatibility
Codecov Report
@@ Coverage Diff @@
## master #1122 +/- ##
=======================================
Coverage 79.32% 79.32%
=======================================
Files 7 7
Lines 711 711
Branches 158 158
=======================================
Hits 564 564
Misses 90 90
Partials 57 57
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@nguyensomniac thanks, seems like a simple change, and thanks for adding a test. Node's docs do not mention the older flag name: Was the flag renamed during node 12's lifetime? |
Yes, it was. Probably even long‑ish before v12 became LTS. |
Ah, you're correct. Running |
Thanks! I added a comment to remind me when this flag was changed. This will be published to npm after I merge #1121; until then, you can install directly from git. I always forget the syntax, but I think it's |
Context here: #1007 (comment)
The
--es-module-specifier-resolution
flag was introduced in Node 12. With the release of Node 13, the flag was renamed to--experimental-specifier-resolution
, with--es-module-specifier-resolution
acting as an alias to the new name.This fix aliases the
--es-module-specifier-resolution
flag in older versions of node, so that module resolution acts as expected. I also changed what seems to be a dead branch in theesm-usage-example
directory.I tested this with node 12, 13, and 14 and all seems to be working as expected.