加载器


稳定性: 1 - 实验

此 API 目前正在重新设计,并将继续更改。

要自定义默认的模块解析,则可以选择通过 Node.js 的 --experimental-loader ./loader-name.mjs 参数提供加载器钩子。

当使用钩子时,它们适用于入口点和所有 import 调用。 它们不适用于 require 调用;那些仍然遵循 CommonJS 规则。

Stability: 1 - Experimental

This API is currently being redesigned and will still change.

To customize the default module resolution, loader hooks can optionally be provided via a --experimental-loader ./loader-name.mjs argument to Node.js.

When hooks are used they apply to the entry point and all import calls. They won't apply to require calls; those still follow CommonJS rules.