-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
99 lines (98 loc) · 2.89 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react-swc';
import { vitePluginForArco } from '@arco-plugins/vite-react';
// https://vitejs.dev/config/
export default defineConfig({
base: './',
plugins: [react(), vitePluginForArco({ style: 'css' })],
resolve: {
alias: {
'@': '/src',
$assets: '/src/assets',
$components: '/src/components',
$hooks: '/src/hooks',
$pages: '/src/pages',
$service: '/src/service',
$src: '/src',
$store: '/src/store',
$utils: '/src/utils'
}
},
css: {
modules: {
exportGlobals: true,
generateScopedName: '[hash:base64:12]',
localsConvention: 'camelCaseOnly'
}
},
server: {
proxy: {
'/api': {
target: 'https://dnspod.tencentcloudapi.com/',
secure: false,
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
headers: {
host: 'dnspod.tencentcloudapi.com',
'content-type': 'application/json; charset=utf-8'
}
}
}
},
preview: {
proxy: {
'/api': {
target: 'https://dnspod.tencentcloudapi.com/',
secure: false,
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
headers: {
host: 'dnspod.tencentcloudapi.com',
'content-type': 'application/json; charset=utf-8'
}
}
}
},
build: {
rollupOptions: {
output: {
manualChunks: {
arco_icon: ['@arco-design/web-react/icon'],
arco_button: ['@arco-design/web-react/es/Button'],
arco_form: ['@arco-design/web-react/es/Form'],
arco_list: ['@arco-design/web-react/es/List'],
arco_select: ['@arco-design/web-react/es/Select'],
// arco_image: ['@arco-design/web-react/es/Image'],
// arco_input: ['@arco-design/web-react/es/Input'],
// arco_input_number: ['@arco-design/web-react/es/InputNumber'],
// arco_message: ['@arco-design/web-react/es/Message'],
// arco_modal: ['@arco-design/web-react/es/Modal'],
// arco_popconfirm: ['@arco-design/web-react/es/Popconfirm'],
// arco_radio: ['@arco-design/web-react/es/Radio'],
arco: ['@arco-design/web-react'],
fortawesome: [
'@fortawesome/fontawesome-svg-core',
'@fortawesome/free-regular-svg-icons',
'@fortawesome/free-solid-svg-icons',
'@fortawesome/react-fontawesome'
],
// axios: ['axios'],
// classnames: ['classnames'],
// localforage: ['localforage'],
// qs: ['qs'],
// uuid: ['uuid'],
react: [
'axios',
'classnames',
'localforage',
'qs',
'react',
'react-dom',
'uuid'
],
react_router: ['react-router-dom']
}
}
}
}
});