--experimental-specifier-resolution=mode


设置解析 ES 模块说明符的解析算法。有效选项为 explicitnode

¥Sets the resolution algorithm for resolving ES module specifiers. Valid options are explicit and node.

默认为 explicit,这需要提供模块的完整路径。node 模式启用对可选文件扩展名的支持以及导入具有索引文件的目录的能力。

¥The default is explicit, which requires providing the full path to a module. The node mode enables support for optional file extensions and the ability to import a directory that has an index file.

有关示例用法,请参见 自定义 ESM 说明符解析

¥See customizing ESM specifier resolution for example usage.