Skip to content

Commit fb78ba1

Browse files
committed
fix: dev mode regression with electron
1 parent b24c305 commit fb78ba1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

vite.config.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ import { fileURLToPath } from "url";
77

88
const __dirname = path.dirname(fileURLToPath(import.meta.url));
99

10-
export default defineConfig({
11-
// Only React plugin for main renderer - WASM plugins excluded to avoid mermaid initialization errors
12-
plugins: [react()],
10+
export default defineConfig(({ mode }) => ({
11+
// WASM plugins only in dev mode - production externalizes tiktoken anyway
12+
// This prevents mermaid initialization errors in production while allowing dev to work
13+
plugins: mode === "development" ? [react(), wasm(), topLevelAwait()] : [react()],
1314
resolve: {
1415
alias: {
1516
"@": path.resolve(__dirname, "./src"),
@@ -49,4 +50,4 @@ export default defineConfig({
4950
target: "esnext",
5051
},
5152
},
52-
});
53+
}));

0 commit comments

Comments
 (0)