mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 03:01:54 +00:00
- Convert .storybook/main.ts to main.mjs to resolve ES module compatibility - Use dynamic imports instead of static imports to avoid require() errors - Add .storybook directory to tsconfig.json includes - Storybook build and dev server now work correctly 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
48 lines
1.1 KiB
JavaScript
48 lines
1.1 KiB
JavaScript
/** @type {import('@storybook/vue3-vite').StorybookConfig} */
|
|
const config = {
|
|
stories: ['../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
|
|
addons: ['@storybook/addon-docs'],
|
|
framework: {
|
|
name: '@storybook/vue3-vite',
|
|
options: {}
|
|
},
|
|
async viteFinal(config) {
|
|
const { mergeConfig } = await import('vite')
|
|
const { fileURLToPath } = await import('url')
|
|
const path = await import('path')
|
|
|
|
const __filename = fileURLToPath(import.meta.url)
|
|
const __dirname = path.dirname(__filename)
|
|
|
|
return mergeConfig(config, {
|
|
server: {
|
|
allowedHosts: true
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': __dirname + '/../src'
|
|
}
|
|
},
|
|
build: {
|
|
rollupOptions: {
|
|
external: (id) => {
|
|
return false
|
|
},
|
|
onwarn: (warning, warn) => {
|
|
if (
|
|
warning.code === 'UNUSED_EXTERNAL_IMPORT' &&
|
|
warning.message?.includes('resolveComponent')
|
|
) {
|
|
return
|
|
}
|
|
warn(warning)
|
|
},
|
|
output: {}
|
|
},
|
|
chunkSizeWarningLimit: 1000
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
export default config |