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', })