From f946c8694056fe05262b08a549f3ff7b484d03ea Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Sun, 23 Jun 2024 22:32:00 +0800 Subject: [PATCH] fix(create-vite): target dir contains special characters (#17549) --- packages/create-vite/src/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/create-vite/src/index.ts b/packages/create-vite/src/index.ts index ce52b4f63f10c7..463c78cf669817 100755 --- a/packages/create-vite/src/index.ts +++ b/packages/create-vite/src/index.ts @@ -449,7 +449,9 @@ async function init() { const [command, ...args] = fullCustomCommand.split(' ') // we replace TARGET_DIR here because targetDir may include a space - const replacedArgs = args.map((arg) => arg.replace('TARGET_DIR', targetDir)) + const replacedArgs = args.map((arg) => + arg.replace('TARGET_DIR', () => targetDir), + ) const { status } = spawn.sync(command, replacedArgs, { stdio: 'inherit', })