Skip to content

Commit

Permalink
fix(template-vite-typescript): make --force flag work (#3829)
Browse files Browse the repository at this point in the history
  • Loading branch information
erickzhao authored Jan 31, 2025
1 parent c5e7165 commit daca492
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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('</body>')) return ' <script type="module" src="/src/renderer.ts"></script>\n </body>';
Expand Down

0 comments on commit daca492

Please sign in to comment.