-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathvite.renderer.config.mts
More file actions
56 lines (55 loc) · 1.38 KB
/
vite.renderer.config.mts
File metadata and controls
56 lines (55 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import path from "path";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [
tailwindcss(),
react({
babel: {
plugins: [["babel-plugin-react-compiler"]],
},
}),
],
resolve: {
preserveSymlinks: true,
alias: {
"@": path.resolve(__dirname, "./src"),
// Provide browser-safe polyfills for Node.js modules
"node:async_hooks": path.resolve(__dirname, "src/polyfills/async-hooks.ts"),
},
},
define: {
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'),
},
build: {
rollupOptions: {
external: ['node-pty',
'electron',
'electron-updater',
"fs",
"path",
"os",
"child_process",],
output: {
manualChunks: {
monaco: ['monaco-editor']
}
}
}
},
worker: {
format: "es",
},
optimizeDeps: {
exclude: ['electron', 'node-pty', 'electron-updater'],
include: [
'monaco-editor/esm/vs/editor/editor.api',
'monaco-editor/esm/vs/editor/editor.worker',
'monaco-editor/esm/vs/language/json/json.worker',
'monaco-editor/esm/vs/language/css/css.worker',
'monaco-editor/esm/vs/language/html/html.worker',
'monaco-editor/esm/vs/language/typescript/ts.worker'
]
},
});