diff --git a/scripts/tasks/sandbox-parts.ts b/scripts/tasks/sandbox-parts.ts index 271fbba9dcd8..5d11bd7380ed 100644 --- a/scripts/tasks/sandbox-parts.ts +++ b/scripts/tasks/sandbox-parts.ts @@ -480,13 +480,22 @@ export async function setupVitest(details: TemplateDetails, options: PassedOptio dedent` import { defineWorkspace, defaultExclude } from "vitest/config"; import { storybookTest } from "@storybook/experimental-addon-test/vitest-plugin"; + import path from 'node:path'; + import { fileURLToPath } from 'node:url'; + + import viteConfig from './vite.config'; + ${frameworkPluginImport} + const dirname = + typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url)); + export default defineWorkspace([ { ${!isNextjs ? `extends: "${viteConfigPath}",` : ''} plugins: [ storybookTest({ + configDir: path.join(dirname, '.storybook'), storybookScript: "yarn storybook --ci", tags: { include: ["vitest"],