forked from dpim/wf-react-app
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvite.config.mts
More file actions
50 lines (49 loc) · 1.4 KB
/
vite.config.mts
File metadata and controls
50 lines (49 loc) · 1.4 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
import { defineConfig } from 'vite'
import viteReact from '@vitejs/plugin-react'
import wfHotReload from '@xatom/wf-app-hot-reload'
import { resolve } from 'node:path'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [wfHotReload(), viteReact()],
// test: {
// globals: true,
// environment: 'jsdom',
// },
server: {
port: 1337,
},
resolve: {
alias: {
'@': resolve(__dirname, './src'),
},
},
base: './',
build: {
rollupOptions: {
output: {
manualChunks: {
// Separate Monaco Editor into its own chunk (it's very large)
'monaco-editor': ['@monaco-editor/react'],
// Separate Material UI core into its own chunk
'mui-core': ['@mui/material', '@emotion/react', '@emotion/styled'],
// Separate Material UI icons (also quite large)
'mui-icons': ['@mui/icons-material'],
// Separate React and React DOM
'react-vendor': ['react', 'react-dom'],
// Separate parsing/AST libraries
'ast-vendor': [
'acorn',
'acorn-jsx',
'acorn-typescript',
'acorn-walk',
'sucrase',
],
// Other vendor libraries
vendor: ['axios', '@tanstack/react-query', 'prismjs'],
},
},
},
// Increase chunk size warning limit to 1000 kB
chunkSizeWarningLimit: 1000,
},
})