File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 1010
1111const { spawn } = require ( 'node:child_process' )
1212const path = require ( 'node:path' )
13+ const { pathToFileURL } = require ( 'node:url' )
1314
1415// When run directly, act as a wrapper script.
1516if ( require . main === module ) {
@@ -26,8 +27,9 @@ if (require.main === module) {
2627 const scriptPath = path . join ( __dirname , scriptFile )
2728
2829 // Run the script with the alias loader.
30+ // Convert loader path to file:// URL for cross-platform ESM loader support (Windows requires file:// URLs)
2931 const loaderPath = path . join ( __dirname , 'utils' , 'alias-loader.mjs' )
30- const args = [ `--loader=${ loaderPath } ` , scriptPath , ...flags ]
32+ const args = [ `--loader=${ pathToFileURL ( loaderPath ) . href } ` , scriptPath , ...flags ]
3133
3234 const child = spawn ( process . execPath , args , {
3335 stdio : 'inherit' ,
You can’t perform that action at this time.
0 commit comments