-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathvite.config.ts
61 lines (58 loc) · 1.37 KB
/
vite.config.ts
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
57
58
59
60
61
import { dirname, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import react from '@vitejs/plugin-react-swc'
import UnoCSS from 'unocss/vite'
// import postcssNested from 'postcss-nested'
import { defineConfig } from 'vite'
import MonacoEditorPlugin from 'vite-plugin-monaco-editor-new'
import Pages from 'vite-plugin-pages'
import svgr from 'vite-plugin-svgr'
const path = fileURLToPath(new URL(import.meta.url))
const root = dirname(path)
// https://vitejs.dev/config/
export default defineConfig({
root,
resolve: {
alias: {
'@': resolve(root, 'src')
}
},
// css: {
// postcss: {
// plugins: [postcssNested]
// }
// },
server: {
port: 8080,
proxy: {
// 测试服地址:https://test.admin.enjoyfreetalk.com
'^/(auth|operations|s3)': 'http://localhost:9991'
}
},
plugins: [
react(),
svgr(),
Pages({
extensions: ['tsx'],
exclude: ['**/components/**/*.*', '**/blocks/**/*.*', '**/hooks/**/*.*'],
routeStyle: 'next',
importMode: 'async',
dirs: 'src/routes',
resolver: 'react'
}),
UnoCSS(),
MonacoEditorPlugin({})
],
optimizeDeps: {
include: [
'@ant-design/icons',
'@ant-design/pro-components',
'amis',
'amis-editor',
'copy-to-clipboard',
'react',
'react-dom',
'react-router-dom'
]
}
})