--preserve-symlinks-main


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

此标志的存在是为了让主模块可以选择加入 --preserve-symlinks 为所有其他导入提供的相同行为;但是,它们是单独的标志,以便与旧的 Node.js 版本向后兼容。

有关详细信息,请参阅 --preserve-symlinks

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

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 does not imply --preserve-symlinks; it is expected that --preserve-symlinks-main will be used in addition to --preserve-symlinks when it is not desirable to follow symlinks before resolving relative paths.

See --preserve-symlinks for more information.