-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
44 lines (42 loc) · 1.13 KB
/
vite.config.ts
File metadata and controls
44 lines (42 loc) · 1.13 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
import path from 'node:path'
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin'
import react from '@vitejs/plugin-react'
import { codeInspectorPlugin } from 'code-inspector-plugin'
import { defineConfig } from 'vite'
import checker from 'vite-plugin-checker'
export default defineConfig({
resolve: {
alias: {
'~': path.resolve(__dirname, 'src'),
buffer: 'buffer',
path: 'path-browserify',
},
},
plugins: [
codeInspectorPlugin({ bundler: 'vite' }),
react(),
vanillaExtractPlugin(),
checker({ typescript: true }),
],
server: {
port: 9528,
},
build: {
target: 'es2022',
sourcemap: false,
rollupOptions: {
output: {
manualChunks(id) {
if (/monaco-editor|@monaco-editor\/react/.test(id)) return 'monaco'
if (/@codemirror\//.test(id)) return 'codemirror'
if (/@haklex\//.test(id)) return 'haklex'
if (/@antv\/g2/.test(id)) return 'charts'
if (/@excalidraw\//.test(id)) return 'excalidraw'
},
},
},
},
optimizeDeps: {
exclude: ['@huacnlee/autocorrect', '@dqbd/tiktoken'],
},
})