diff --git a/.storybook/main.ts b/.storybook/main.ts index 04f806021c..b3d43469b4 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -1,7 +1,7 @@ import type { StorybookConfig } from '@storybook-vue/nuxt' const config = { - stories: ['../app/**/*.stories.@(js|ts)'], + stories: ['../.storybook/*.mdx', '../app/**/*.stories.@(js|ts)'], addons: ['@storybook/addon-a11y', '@storybook/addon-docs', '@storybook/addon-themes'], framework: '@storybook-vue/nuxt', staticDirs: ['./.public'], @@ -11,6 +11,33 @@ const config = { async viteFinal(newConfig) { newConfig.plugins ??= [] + // Bridge compatibility between Storybook v10 core and v9 @storybook-vue/nuxt + // v10 expects module federation globals that v9 doesn't provide + newConfig.plugins.push({ + name: 'storybook-v10-compat', + transformIndexHtml: { + order: 'pre', + handler(html) { + const script = ` +` + return html.replace(/