hello.mts
:
const hello = 'hello';
export default hello;
static.mjs
:
import hello from './hello.mjs';
console.log(hello);
Execute
node --loader @esbuild-kit/esm-loader static.mjs
Error
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/mshima/git/test/hello.mjs' imported from /Users/mshima/git/test/static.mjs
This is useful for allowJs
option.