[fix] Replace __dirname with process.cwd() in Storybook config

__dirname is not available in all environments. Using process.cwd()
provides better compatibility and resolves path issues in Storybook.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
snomiao
2025-08-16 06:38:50 +00:00
parent 171d0960ef
commit c8772230fb

View File

@@ -34,7 +34,7 @@ const config: StorybookConfig = {
compiler: 'vue3', compiler: 'vue3',
customCollections: { customCollections: {
comfy: FileSystemIconLoader( comfy: FileSystemIconLoader(
__dirname + '/../src/assets/icons/custom' process.cwd() + '/src/assets/icons/custom'
) )
} }
}), }),
@@ -46,9 +46,9 @@ const config: StorybookConfig = {
}) })
], ],
dirs: [ dirs: [
__dirname + '/../src/components', process.cwd() + '/src/components',
__dirname + '/../src/layout', process.cwd() + '/src/layout',
__dirname + '/../src/views' process.cwd() + '/src/views'
], ],
deep: true, deep: true,
extensions: ['vue'] extensions: ['vue']
@@ -60,7 +60,7 @@ const config: StorybookConfig = {
}, },
resolve: { resolve: {
alias: { alias: {
'@': __dirname + '/../src' '@': process.cwd() + '/src'
} }
}, },
build: { build: {