import.meta.filename
版本历史
| 版本 | 变更 |
|---|---|
| v24.0.0 | 此属性不再处于实验阶段。 |
| v21.2.0, v20.11.0 | 新增于: v21.2.0, v20.11.0 |
-
类型:<string> 当前模块的完整绝对路径和文件名,带有已解析的符号链接。
\Type: <string> The full absolute path and filename of the current module, with symlinks resolved.
这与 import.meta.url 的 url.fileURLToPath() 相同。
\This is the same as the url.fileURLToPath() of the import.meta.url.
警告 只有本地模块支持此属性。不使用
file:协议的模块将不会提供它。\only local modules support this property. Modules not using the
file:protocol will not provide it.