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
60 stars 22 forks source link

fix for Node.js 17.6.0 #11

Closed bengl closed 2 years ago

bengl commented 2 years ago

In Node.js 17.6.0, arbitrary protocol names can't be passed through the hooks. Here we bypass this check by changing the prefix used.

Before:

iitm:

After:

file:iitm:

This way it looks like a file URL.