Uh oh!
There was an error while loading. Please reload this page.
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.
|
cspotcode
commented
Sep 14, 2020
@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? |
ExE-Boss
commented
Sep 14, 2020
Yes, it was. Probably even long‑ish before v12 became LTS. |
nguyensomniac
commented
Sep 14, 2020
Ah, you're correct. Running |
cspotcode
commented
Sep 15, 2020
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-resolutionflag was introduced in Node 12. With the release of Node 13, the flag was renamed to--experimental-specifier-resolution, with--es-module-specifier-resolutionacting as an alias to the new name.This fix aliases the
--es-module-specifier-resolutionflag 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-exampledirectory.I tested this with node 12, 13, and 14 and all seems to be working as expected.