-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
44 lines (41 loc) · 1.02 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
// https://github.com/antfu/unplugin-vue-components 组件按需引入插件
import Components from 'unplugin-vue-components/vite'
import { ElementUiResolver } from 'unplugin-vue-components/resolvers'
// 兼容 IE
import legacy from '@vitejs/plugin-legacy'
// 分离打包
import { defineConfig, splitVendorChunkPlugin } from 'vite'
// 支持 Vue2
import Vue from '@vitejs/plugin-vue2'
import vueJsx from '@vitejs/plugin-vue2-jsx'
import { resolve } from 'path'
export default defineConfig({
plugins: [
Vue(),
vueJsx(),
Components({
resolvers: [ElementUiResolver()],
}),
legacy({
targets: ['defaults', 'not ie < 9'],
}),
splitVendorChunkPlugin(),
],
resolve: {
alias: {
'@': resolve(__dirname, './examples/src'),
src: resolve(__dirname, './src'),
packages: resolve('./packages'),
examples: resolve('./examples'),
}
},
build: {
rollupOptions: {
output: {
manualChunks: {
'element-ui': ['element-ui'],
},
},
},
}
})