Skip to content

Commit ee57f14

Browse files
committed
Fix Windows CI ESM loader path issue
Convert loader path to file:// URL for cross-platform compatibility. Windows requires file:// URLs for ESM loader paths.
1 parent c750486 commit ee57f14

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/load.cjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
const { spawn } = require('node:child_process')
1212
const path = require('node:path')
13+
const { pathToFileURL } = require('node:url')
1314

1415
// When run directly, act as a wrapper script.
1516
if (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',

0 commit comments

Comments
 (0)