import.meta.filename


  • <string> 当前模块的完整绝对路径和文件名,带有已解析的符号链接。

    ¥<string> The full absolute path and filename of the current module, with symlinks resolved.

这与 import.meta.urlurl.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.