-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
52 lines (51 loc) · 1.21 KB
/
vite.config.js
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
import { defineConfig } from 'vite';
import path from 'path';
import react from '@vitejs/plugin-react';
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',
],
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'],
},
},
},
},
publicDir: 'static',
});