From f968c85fc25b527db2e1fcb814b3e64affa6c73c Mon Sep 17 00:00:00 2001 From: Ian VanSchooten Date: Thu, 1 Sep 2022 16:33:00 -0400 Subject: [PATCH] Don't add babel dependencies for vite projects --- code/lib/cli/src/generators/baseGenerator.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/lib/cli/src/generators/baseGenerator.ts b/code/lib/cli/src/generators/baseGenerator.ts index 86b63d4fb334..9add3c784bf0 100644 --- a/code/lib/cli/src/generators/baseGenerator.ts +++ b/code/lib/cli/src/generators/baseGenerator.ts @@ -221,7 +221,10 @@ export async function baseGenerator( await fse.writeFile(`.storybook/preview-head.html`, previewHead, { encoding: 'utf8' }); } - const babelDependencies = addBabel ? await getBabelDependencies(packageManager, packageJson) : []; + const babelDependencies = + addBabel && builder !== CoreBuilder.Vite + ? await getBabelDependencies(packageManager, packageJson) + : []; const isNewFolder = !files.some( (fname) => fname.startsWith('.babel') || fname.startsWith('babel') || fname === 'package.json' );