From 7e01aab1e1bd59fb28b796a285a31f80e126b42a Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Tue, 17 Jun 2025 15:53:53 +0200 Subject: [PATCH] Sandbox: Override the right vitest.config file depending on language --- scripts/tasks/sandbox-parts.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/tasks/sandbox-parts.ts b/scripts/tasks/sandbox-parts.ts index ae8fb2031516..7f51bd0c43d0 100644 --- a/scripts/tasks/sandbox-parts.ts +++ b/scripts/tasks/sandbox-parts.ts @@ -398,7 +398,11 @@ export async function setupVitest(details: TemplateDetails, options: PassedOptio ? template.expected.framework : template.expected.renderer; - const setupFilePath = join(sandboxDir, '.storybook/vitest.setup.ts'); + const isTypeScriptSandbox = template.name.includes('TypeScript'); + const setupFilePath = join( + sandboxDir, + isTypeScriptSandbox ? '.storybook/vitest.setup.ts' : '.storybook/vitest.setup.js' + ); const shouldUseCsf4 = template.expected.framework === '@storybook/react-vite'; if (shouldUseCsf4) {