--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.