diff --git a/code/lib/cli/src/automigrate/fixes/vite-config-file.ts b/code/lib/cli/src/automigrate/fixes/vite-config-file.ts index 1719035fc220..63fdb659d4d6 100644 --- a/code/lib/cli/src/automigrate/fixes/vite-config-file.ts +++ b/code/lib/cli/src/automigrate/fixes/vite-config-file.ts @@ -14,7 +14,7 @@ export const viteConfigFile = { id: 'viteConfigFile', async check({ mainConfig, packageManager }) { - const viteConfigPath = await findUp([ + let viteConfigPath = await findUp([ 'vite.config.js', 'vite.config.mjs', 'vite.config.cjs', @@ -45,6 +45,15 @@ export const viteConfigFile = { const rendererName = frameworkToRenderer[frameworkName as keyof typeof frameworkToRenderer]; + if ( + !viteConfigFile && + mainConfig.core?.builder && + typeof mainConfig.core?.builder !== 'string' && + mainConfig.core?.builder.options + ) { + viteConfigPath = mainConfig.core?.builder.options.viteConfigPath; + } + if (!viteConfigPath && isUsingViteBuilder) { const plugins = [];