--preserve-symlinks-main


指示模块加载器在解析和缓存主模块(require.main)时保留符号链接。

【Instructs the module loader to preserve symbolic links when resolving and caching the main module (require.main).】

这个标志存在是为了让主模块可以选择采用 --preserve-symlinks 对所有其他导入所提供的相同行为;不过,它们是单独的标志,以便向旧版本的 Node.js 保持向后兼容。

【This flag exists so that the main module can be opted-in to the same behavior that --preserve-symlinks gives to all other imports; they are separate flags, however, for backward compatibility with older Node.js versions.】

--preserve-symlinks-main 并不意味着 --preserve-symlinks;当不希望在解析相对路径之前跟随符号链接时,应将 --preserve-symlinks-main--preserve-symlinks 一起使用。

有关更多信息,请参见--preserve-symlinks

【See --preserve-symlinks for more information.】