Skip to content

Commit 3a1170e

Browse files
branchseerclaude
andcommitted
fix: detect vite.config.js when vite.config.ts doesn't exist
Migration preserves the existing config extension. Some projects use vite.config.js, so we need to check both filenames. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8a656e0 commit 3a1170e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ecosystem-ci/patch-project.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { execSync } from 'node:child_process';
2+
import { existsSync } from 'node:fs';
23
import { readFile, writeFile } from 'node:fs/promises';
34
import { join } from 'node:path';
45

@@ -45,8 +46,11 @@ execSync(`${cli} migrate --no-agent --no-interactive`, {
4546
},
4647
});
4748

48-
// Enable cacheScripts so e2e tests exercise the cache hit/miss paths
49-
const viteConfigPath = join(cwd, 'vite.config.ts');
49+
// Enable cacheScripts so e2e tests exercise the cache hit/miss paths.
50+
// Migration preserves the existing config extension (.ts or .js).
51+
const viteConfigPath = existsSync(join(cwd, 'vite.config.ts'))
52+
? join(cwd, 'vite.config.ts')
53+
: join(cwd, 'vite.config.js');
5054
const viteConfig = await readFile(viteConfigPath, 'utf-8');
5155
await writeFile(
5256
viteConfigPath,

0 commit comments

Comments
 (0)