2026-07-10 15:16:21 +00:00
|
|
|
import type { StorybookConfig } from '@storybook/vue3-vite'
|
|
|
|
|
import type { PluginOption } from 'vite'
|
|
|
|
|
|
|
|
|
|
function flattenPlugins(plugins: PluginOption[]): PluginOption[] {
|
|
|
|
|
return plugins.flatMap((plugin) => (Array.isArray(plugin) ? flattenPlugins(plugin) : [plugin]))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const config: StorybookConfig = {
|
2026-07-10 19:26:51 +00:00
|
|
|
stories: ['../src/**/*.stories.@(js|ts)', '../packages/vue/src/**/*.stories.@(js|ts)'],
|
2026-07-10 15:16:21 +00:00
|
|
|
addons: ['@storybook/addon-docs', '@storybook/addon-a11y', '@storybook/addon-themes'],
|
|
|
|
|
framework: {
|
|
|
|
|
name: '@storybook/vue3-vite',
|
2026-08-18 19:52:18 +00:00
|
|
|
options: { docgen: false }
|
2026-07-10 15:16:21 +00:00
|
|
|
},
|
|
|
|
|
viteFinal(config) {
|
|
|
|
|
const excludedPluginPrefixes = [
|
|
|
|
|
'copy-canvaskit-wasm',
|
|
|
|
|
'open-pencil-automation',
|
|
|
|
|
'vite-plugin-pwa'
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
config.plugins = flattenPlugins(config.plugins ?? []).filter((plugin) => {
|
|
|
|
|
if (!plugin || typeof plugin !== 'object' || !('name' in plugin)) return true
|
|
|
|
|
return !excludedPluginPrefixes.some((prefix) => plugin.name.startsWith(prefix))
|
|
|
|
|
})
|
|
|
|
|
return config
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default config
|