From 1307cd3ed491275326b602b0ab81bc66a18a5bf1 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Mon, 19 Feb 2024 10:12:57 +0100 Subject: [PATCH] resolve https://github.com/storybookjs/storybook/pull/25934#pullrequestreview-1881973378 --- .../lib/cli/src/automigrate/fixes/vite-config-file.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 = [];