ECMAScript 模块加载器入口点警告


🌐 ECMAScript modules loader entry point caveat

在加载时,ES 模块加载器 会加载程序入口点,node 命令只接受 .js.mjs.cjs.wasm 扩展名的文件作为输入;当传递 --experimental-default-type=module 时,也可以接受没有扩展名的文件。使用以下标志,可以启用额外的文件扩展名:

🌐 When loading, the ES module loader loads the program entry point, the node command will accept as input only files with .js, .mjs, .cjs or .wasm extensions; and with no extension when --experimental-default-type=module is passed. With the following flags, additional file extensions are enabled: