nodejs / import-in-the-middle

Like `require-in-the-middle`, but for ESM import
https://www.npmjs.com/package/import-in-the-middle
Apache License 2.0
55 stars 22 forks source link

Fix ESM in Node v18.19.0 #44

Closed jsumners-nr closed 7 months ago

jsumners-nr commented 7 months ago

Node v18.19.0 includes a backport of ESM loading on a separate thread -- https://github.com/nodejs/node/commit/bac9b1758f36fb3504589ffc5ed610d574dca47d. This PR updates the version check to use AST parsing on Node >= 18.19.0.

trentm commented 7 months ago

Nice. Thanks! I was just coming here for this.