-
-
Notifications
You must be signed in to change notification settings - Fork 539
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
ESM support: can't recognize '--experimental-specifier-resolution' flag passed via NODE_OPTIONS #1072
ESM support: can't recognize '--experimental-specifier-resolution' flag passed via NODE_OPTIONS #1072
Comments
I'm marking this as "help wanted" to indicate that we'll wait for a pull request. This seems like a straightforward contribution.
ts-node/dist-raw/node-esm-resolve-implementation.js Lines 1 to 4 in 44c61af
To write an ESM loader, we need to mimic many built-in behaviors of node. Unfortunately node does not expose this functionality via an API. So our best option for maintainability is to copy-paste node's own implementation where appropriate, tweaking as needed. See also: discussion in #1010, where @evg656e helped me implement our |
Yep, I missed the need to parse the Unfortunately, the The workaround to use ParseNodeOptionsEnvVar from node source. I rewrote getOptionValue code in my branch. As you can see, the code becomes quite messy, so it may be worth putting it into a separate file to keep main module clean. |
Code at
ts-node/dist-raw/node-esm-resolve-implementation.js
Line 73 in 44c61af
The text was updated successfully, but these errors were encountered: