From bedda6a41743002de5ae47db45f64eb809e5a414 Mon Sep 17 00:00:00 2001 From: Lena Morita Date: Thu, 4 Jun 2026 11:09:37 +0200 Subject: [PATCH 1/2] Fix dev script path handling on Windows --- tools/build-scripts/dev.mjs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tools/build-scripts/dev.mjs b/tools/build-scripts/dev.mjs index 8f2c3ef051398b..7faee9acc1d651 100644 --- a/tools/build-scripts/dev.mjs +++ b/tools/build-scripts/dev.mjs @@ -3,7 +3,8 @@ /** * External dependencies */ -import { execSync, spawn } from 'child_process'; +import { execSync } from 'child_process'; +import spawn from 'cross-spawn'; import { fileURLToPath } from 'url'; import path from 'path'; import fs from 'fs'; @@ -28,7 +29,6 @@ function exec( command, args = [], options = {} ) { const childOptions = { cwd: ROOT_DIR, stdio: silent ? 'pipe' : 'inherit', - shell: true, ...spawnOptions, }; @@ -89,7 +89,6 @@ function execAsync( command, args = [], options = {} ) { return spawn( command, args, { cwd: ROOT_DIR, stdio: 'inherit', - shell: true, ...options, } ); } @@ -146,7 +145,7 @@ async function dev() { // This must happen before TypeScript compilation because some packages // (like vips) have source files that import from generated worker-code.ts - await exec( 'node', [ + await exec( process.execPath, [ path.join( __dirname, 'packages/generate-worker-placeholders.mjs' ), ] ); @@ -162,7 +161,7 @@ async function dev() { console.log( ` āœ” Built TypeScript types (${ buildTime }ms)` ); console.log( '\nāœ… Checking type declaration files...' ); - await exec( 'node', [ + await exec( process.execPath, [ path.join( __dirname, 'packages/check-build-type-declaration-files.cjs' @@ -170,7 +169,7 @@ async function dev() { ] ); console.log( '\nšŸ“¦ Building vendor files...' ); - await exec( 'node', [ + await exec( process.execPath, [ path.join( __dirname, 'packages/build-vendors.mjs' ), ] ); @@ -198,7 +197,6 @@ async function dev() { const buildWatch = spawn( 'wp-build', [ '--watch' ], { cwd: ROOT_DIR, stdio: [ 'inherit', 'pipe', 'inherit' ], - shell: true, env: { ...process.env, NODE_ENV: 'development' }, } ); From 102efbb96d182b2930eba7d8ef54bee511b87a02 Mon Sep 17 00:00:00 2001 From: Lena Morita Date: Thu, 4 Jun 2026 13:39:21 +0200 Subject: [PATCH 2/2] Use node command in dev script --- tools/build-scripts/dev.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/build-scripts/dev.mjs b/tools/build-scripts/dev.mjs index 7faee9acc1d651..f6a419e2f814e3 100644 --- a/tools/build-scripts/dev.mjs +++ b/tools/build-scripts/dev.mjs @@ -145,7 +145,7 @@ async function dev() { // This must happen before TypeScript compilation because some packages // (like vips) have source files that import from generated worker-code.ts - await exec( process.execPath, [ + await exec( 'node', [ path.join( __dirname, 'packages/generate-worker-placeholders.mjs' ), ] ); @@ -161,7 +161,7 @@ async function dev() { console.log( ` āœ” Built TypeScript types (${ buildTime }ms)` ); console.log( '\nāœ… Checking type declaration files...' ); - await exec( process.execPath, [ + await exec( 'node', [ path.join( __dirname, 'packages/check-build-type-declaration-files.cjs' @@ -169,7 +169,7 @@ async function dev() { ] ); console.log( '\nšŸ“¦ Building vendor files...' ); - await exec( process.execPath, [ + await exec( 'node', [ path.join( __dirname, 'packages/build-vendors.mjs' ), ] );