diff --git a/packages/template/vite-typescript/src/ViteTypeScriptTemplate.ts b/packages/template/vite-typescript/src/ViteTypeScriptTemplate.ts index dd163cab02..3c23f07562 100644 --- a/packages/template/vite-typescript/src/ViteTypeScriptTemplate.ts +++ b/packages/template/vite-typescript/src/ViteTypeScriptTemplate.ts @@ -47,7 +47,7 @@ class ViteTypeScriptTemplate extends BaseTemplate { // TODO: Compatible with any path entry. // Vite uses index.html under the root path as the entry point. - await fs.move(filePath('index.html'), path.join(directory, 'index.html')); + await fs.move(filePath('index.html'), path.join(directory, 'index.html'), { overwrite: options.force }); await this.updateFileByLine(path.join(directory, 'index.html'), (line) => { if (line.includes('link rel="stylesheet"')) return ''; if (line.includes('')) return ' \n ';