()
| 119 | } |
| 120 | |
| 121 | function ensureViteConfig() { |
| 122 | const root = getProjectRootPath(); |
| 123 | const viteConfigPath = path.join(root, 'vite.config.ts'); |
| 124 | if (fs.existsSync(viteConfigPath)) { |
| 125 | return; |
| 126 | } |
| 127 | const flavor = resolveFlavor(); |
| 128 | const { importLine, configExpr } = getFlavorImportAndConfig(flavor); |
| 129 | const contents = `import { defineConfig } from 'vite';\n${importLine};\n\nexport default defineConfig(({ mode }) => ${configExpr});\n`; |
| 130 | fs.writeFileSync(viteConfigPath, contents, 'utf8'); |
| 131 | } |
| 132 | |
| 133 | export async function runInit() { |
| 134 | const pkg = readPackageJson(); |
no test coverage detected