@@ -236,6 +236,11 @@ bool trace_warnings = false;
236
236
// that is used by lib/module.js
237
237
bool config_preserve_symlinks = false ;
238
238
239
+ // Set in node.cc by ParseArgs when --preserve-symlinks-main is used.
240
+ // Used in node_config.cc to set a constant on process.binding('config')
241
+ // that is used by lib/module.js
242
+ bool config_preserve_symlinks_main = false ;
243
+
239
244
// Set in node.cc by ParseArgs when --experimental-modules is used.
240
245
// Used in node_config.cc to set a constant on process.binding('config')
241
246
// that is used by lib/module.js
@@ -3519,6 +3524,8 @@ static void PrintHelp() {
3519
3524
" --pending-deprecation emit pending deprecation warnings\n "
3520
3525
#if defined(NODE_HAVE_I18N_SUPPORT)
3521
3526
" --preserve-symlinks preserve symbolic links when resolving\n "
3527
+ " --preserve-symlinks-main preserve symbolic links when resolving\n "
3528
+ " the main module\n "
3522
3529
#endif
3523
3530
" --prof-process process v8 profiler output generated\n "
3524
3531
" using --prof\n "
@@ -3569,7 +3576,6 @@ static void PrintHelp() {
3569
3576
" -r, --require module to preload (option can be "
3570
3577
" repeated)\n "
3571
3578
" -v, --version print Node.js version\n "
3572
-
3573
3579
" \n "
3574
3580
" Environment variables:\n "
3575
3581
" NODE_DEBUG ','-separated list of core modules\n "
@@ -3832,6 +3838,8 @@ static void ParseArgs(int* argc,
3832
3838
Revert (cve);
3833
3839
} else if (strcmp (arg, " --preserve-symlinks" ) == 0 ) {
3834
3840
config_preserve_symlinks = true ;
3841
+ } else if (strcmp (arg, " --preserve-symlinks-main" ) == 0 ) {
3842
+ config_preserve_symlinks_main = true ;
3835
3843
} else if (strcmp (arg, " --experimental-modules" ) == 0 ) {
3836
3844
config_experimental_modules = true ;
3837
3845
new_v8_argv[new_v8_argc] = " --harmony-dynamic-import" ;
@@ -4276,6 +4284,12 @@ void Init(int* argc,
4276
4284
SafeGetenv (" NODE_PRESERVE_SYMLINKS" , &text) && text[0 ] == ' 1' ;
4277
4285
}
4278
4286
4287
+ {
4288
+ std::string text;
4289
+ config_preserve_symlinks_main =
4290
+ SafeGetenv (" NODE_PRESERVE_SYMLINKS_MAIN" , &text) && text[0 ] == ' 1' ;
4291
+ }
4292
+
4279
4293
if (config_warning_file.empty ())
4280
4294
SafeGetenv (" NODE_REDIRECT_WARNINGS" , &config_warning_file);
4281
4295
0 commit comments