Skip to content

Commit

Permalink
fix(storybook): inform user vite is used if project uses vite (#13499)
Browse files Browse the repository at this point in the history
  • Loading branch information
mandarini committed Nov 30, 2022
1 parent 0ce6735 commit f545b29
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/storybook/src/generators/configuration/configuration.ts
Expand Up @@ -49,7 +49,13 @@ export async function configurationGenerator(
const { nextBuildTarget, compiler, viteBuildTarget } =
findStorybookAndBuildTargetsAndCompiler(targets);

console.log(findStorybookAndBuildTargetsAndCompiler(targets));
if (viteBuildTarget && schema.bundler !== 'vite') {
logger.info(
`Your project ${schema.name} uses Vite as a bundler.
Nx will configure Storybook for this project to use Vite as well.`
);
schema.bundler = 'vite';
}

const initTask = await initGenerator(tree, {
uiFramework: schema.uiFramework,
Expand All @@ -68,7 +74,7 @@ export async function configurationGenerator(
projectType,
!!nextBuildTarget,
compiler === 'swc',
schema.bundler === 'vite' || !!viteBuildTarget
schema.bundler === 'vite'
);
} else {
createRootStorybookDir(tree, schema.js, schema.tsConfiguration);
Expand All @@ -80,7 +86,7 @@ export async function configurationGenerator(
schema.tsConfiguration,
!!nextBuildTarget,
compiler === 'swc',
schema.bundler === 'vite' || !!viteBuildTarget
schema.bundler === 'vite'
);
}

Expand Down

0 comments on commit f545b29

Please sign in to comment.