特性
¥Features
默认解析器具有以下属性:
¥The default resolver has the following properties:
-
ES 模块使用的基于 FileURL 的解析
¥FileURL-based resolution as is used by ES modules
-
相对和绝对的网址解析
¥Relative and absolute URL resolution
-
没有默认的扩展名
¥No default extensions
-
没有主文件夹
¥No folder mains
-
通过 node_modules 进行裸说明符包解析查找
¥Bare specifier package resolution lookup through node_modules
-
不会在未知扩展或协议上失败
¥Does not fail on unknown extensions or protocols
-
可以选择向加载阶段提供格式提示
¥Can optionally provide a hint of the format to the loading phase
默认加载器具有以下属性
¥The default loader has the following properties
-
支持通过
node:
URL 加载内置模块¥Support for builtin module loading via
node:
URLs -
支持通过
data:
URL 加载 "inline" 模块¥Support for "inline" module loading via
data:
URLs -
支持
file:
模块加载¥Support for
file:
module loading -
在任何其他 URL 协议上失败
¥Fails on any other URL protocol
-
加载
file:
的未知扩展失败(仅支持.cjs
、.js
和.mjs
)¥Fails on unknown extensions for
file:
loading (supports only.cjs
,.js
, and.mjs
)