Files
ComfyUI_frontend/.storybook/main.ts
snomiao 308b3cd334 [feat] Improve Storybook configuration and setup
- Add comprehensive PrimeVue theme setup with ComfyUI preset
- Configure proper Vue app setup with Pinia stores, i18n, and services
- Remove unused onboarding addon from Storybook dependencies
- Improve Vite configuration with better chunking and alias resolution
- Add proper CSS imports and styling for ComfyUI components

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-19 01:55:58 +00:00

54 lines
1.5 KiB
TypeScript

import type { StorybookConfig } from '@storybook/vue3-vite'
import { type InlineConfig, mergeConfig } from 'vite'
import path from 'path'
import { fileURLToPath } from 'url'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const config: StorybookConfig = {
stories: ['../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: ['@storybook/addon-docs'],
framework: {
name: '@storybook/vue3-vite',
options: {}
},
async viteFinal(config) {
return mergeConfig(config, {
server: {
allowedHosts: true
},
resolve: {
alias: {
'@': __dirname + '/../src'
}
},
build: {
rollupOptions: {
external: (id) => {
// Suppress warnings for unused Vue internal imports
return false
},
onwarn: (warning, warn) => {
// Suppress specific warnings
if (warning.code === 'UNUSED_EXTERNAL_IMPORT' && warning.message?.includes('resolveComponent')) {
return
}
warn(warning)
},
output: {
manualChunks: {
'vue-vendor': ['vue', 'vue-router'],
'primevue': ['primevue/config', 'primevue'],
'storybook-docs': ['@storybook/docs-tools'],
'litegraph': ['./src/lib/litegraph']
}
}
},
chunkSizeWarningLimit: 1000
}
} satisfies InlineConfig)
}
}
export default config