From 7cf493a6f8688228ee75f0db606d566277952da2 Mon Sep 17 00:00:00 2001 From: Hooray <304327508@qq.com> Date: Wed, 1 Apr 2026 12:21:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Ddev/build/serve?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E6=97=A0=E6=B3=95=E5=9C=A8=20Windows=20?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E6=AD=A3=E5=B8=B8=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/build.ts | 2 ++ scripts/dev.ts | 2 ++ scripts/serve.ts | 2 ++ 3 files changed, 6 insertions(+) diff --git a/scripts/build.ts b/scripts/build.ts index ad0364ee..ec91901e 100755 --- a/scripts/build.ts +++ b/scripts/build.ts @@ -9,6 +9,7 @@ import * as p from '@clack/prompts' const __dirname = path.dirname(fileURLToPath(import.meta.url)) const rootDir = path.resolve(__dirname, '..') +const isWindows = process.platform === 'win32' let childProcess: ReturnType | null = null @@ -59,6 +60,7 @@ async function runBuild(packageName: string, script: string): Promise { childProcess = spawn('pnpm', ['--filter', packageName, 'run', script], { stdio: 'inherit', cwd: rootDir, + shell: isWindows, }) childProcess.on('close', (code) => { diff --git a/scripts/dev.ts b/scripts/dev.ts index 316710fd..6955e8a6 100755 --- a/scripts/dev.ts +++ b/scripts/dev.ts @@ -9,6 +9,7 @@ import * as p from '@clack/prompts' const __dirname = path.dirname(fileURLToPath(import.meta.url)) const rootDir = path.resolve(__dirname, '..') +const isWindows = process.platform === 'win32' let childProcess: ReturnType | null = null @@ -56,6 +57,7 @@ async function runDev(packageName: string): Promise { childProcess = spawn('pnpm', ['--filter', packageName, 'run', 'dev'], { stdio: 'inherit', cwd: rootDir, + shell: isWindows, }) childProcess.on('close', (code) => { diff --git a/scripts/serve.ts b/scripts/serve.ts index cc2ebb79..b07e3fd6 100755 --- a/scripts/serve.ts +++ b/scripts/serve.ts @@ -9,6 +9,7 @@ import * as p from '@clack/prompts' const __dirname = path.dirname(fileURLToPath(import.meta.url)) const rootDir = path.resolve(__dirname, '..') +const isWindows = process.platform === 'win32' let childProcess: ReturnType | null = null @@ -59,6 +60,7 @@ async function runServe(packageName: string, script: string): Promise { childProcess = spawn('pnpm', ['--filter', packageName, 'run', script], { stdio: 'inherit', cwd: rootDir, + shell: isWindows, }) childProcess.on('close', (code) => {