Closed chloe463 closed 1 year ago
The current register/esm does not resolve relative file path correctly. For example, the following code and command doesn't run properly.
register/esm
code
// index.mts import './foo.mjs' foo()
command node --loader @swc-node/register/esm index.mts
node --loader @swc-node/register/esm index.mts
and the error
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/path/to/foo.mjs' imported from /path/to/index.mts.mjs
This PR fixes the problem.
All committers have signed the CLA.
The current
register/esm
does not resolve relative file path correctly. For example, the following code and command doesn't run properly.code
command
node --loader @swc-node/register/esm index.mts
and the error
This PR fixes the problem.