-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.js
More file actions
55 lines (54 loc) · 1.29 KB
/
vite.config.js
File metadata and controls
55 lines (54 loc) · 1.29 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
import path from "node:path";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [react()],
server: {
open: true,
fs: {
// Allow serving files from one level up to the src directory
allow: [".."],
},
},
resolve: {
alias: {
"@": path.resolve(__dirname, "src"),
"monaco-editor": path.resolve(__dirname, "node_modules/monaco-editor"),
},
preserveSymlinks: true,
},
worker: {
format: "es",
plugins: [],
rollupOptions: {
output: {
sourcemap: false, // Disable source maps for workers
},
},
},
optimizeDeps: {
include: [
"monaco-editor/esm/vs/language/json/json.worker",
"monaco-editor/esm/vs/editor/editor.worker",
"react",
"react-dom",
],
exclude: ["monaco-editor"],
},
build: {
outDir: "public",
assetsDir: "assets",
sourcemap: true, // Enable source maps for main bundle
rollupOptions: {
output: {
manualChunks: {
monaco: ["monaco-editor"],
editor: ["monaco-editor/esm/vs/editor/editor.worker"],
json: ["monaco-editor/esm/vs/language/json/json.worker"],
vendor: ["react", "react-dom"],
},
},
},
},
publicDir: "static",
});