File tree Expand file tree Collapse file tree 2 files changed +10
-27
lines changed
Expand file tree Collapse file tree 2 files changed +10
-27
lines changed Original file line number Diff line number Diff line change @@ -91,16 +91,20 @@ module.exports = function (
9191 function start ( ) {
9292 isPaused = false ;
9393
94- const loaderURL = pathToFileURL ( resolveMain ( localPath ( join ( 'loaders' , 'load.mjs' ) ) ) ) ;
94+ const args = nodeArgs . slice ( ) ;
95+
96+ args . push ( `--require=${ resolveMain ( localPath ( 'wrap' ) ) } ` ) ;
97+
98+ const loaderURL = pathToFileURL ( resolveMain ( localPath ( join ( 'loaders' , `load.mjs` ) ) ) ) ;
99+
100+ if ( ! semver . satisfies ( process . version , '>=21.0.0' ) ) {
101+ args . push ( `--experimental-loader=${ loaderURL . href } ` ) ;
102+ }
95103
96104 child = fork ( script , scriptArgs , {
97105 cwd : process . cwd ( ) ,
98106 env : process . env ,
99- execArgv : [
100- ...nodeArgs . slice ( ) ,
101- `--experimental-loader=${ loaderURL . href } ` ,
102- `--require=${ resolveMain ( localPath ( 'wrap' ) ) } `
103- ]
107+ execArgv : args
104108 } ) ;
105109
106110 if ( respawn ) {
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments