Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

chore: prevent Storybook crash caused by vite-plugin-inspect (#33039)

yyhebda5efe2751
diff --git a/web/vite.config.ts b/web/vite.config.ts
index b07e7ea7bef..83a35f85586 100644
--- a/web/vite.config.ts
+++ b/web/vite.config.ts
@@ -160,6 +160,8 @@ if (import.meta.hot) {
export default defineConfig(({ mode }) => {
const isTest = mode === 'test'
+ const isStorybook = process.env.STORYBOOK === 'true'
+ || process.argv.some(arg => arg.toLowerCase().includes('storybook'))
return {
plugins: isTest
@@ -176,14 +178,19 @@ export default defineConfig(({ mode }) => {
},
} as Plugin,
]
- : [
- Inspect(),
- createCodeInspectorPlugin(),
- createForceInspectorClientInjectionPlugin(),
- react(),
- vinext(),
- customI18nHmrPlugin(),
- ],
+ : isStorybook
+ ? [
+ tsconfigPaths(),
+ react(),
+ ]
+ : [
+ Inspect(),
+ createCodeInspectorPlugin(),
+ createForceInspectorClientInjectionPlugin(),
+ react(),
+ vinext(),
+ customI18nHmrPlugin(),
+ ],
resolve: {
alias: {
'~@': __dirname,
@@ -191,7 +198,7 @@ export default defineConfig(({ mode }) => {
},
// vinext related config
- ...(!isTest
+ ...(!isTest && !isStorybook
? {
optimizeDeps: {
exclude: ['nuqs'],