-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvite.config.ts
More file actions
105 lines (103 loc) · 2.3 KB
/
vite.config.ts
File metadata and controls
105 lines (103 loc) · 2.3 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
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
100
101
102
103
104
105
import vue from '@vitejs/plugin-vue'
import path from 'path'
import AutoImport from 'unplugin-auto-import/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import Components from 'unplugin-vue-components/vite'
import { defineConfig } from 'vite'
import { autoComplete, Plugin as importToCDN } from 'vite-plugin-cdn-import'
import VueSetupExtend from 'vite-plugin-vue-setup-extend'
export default defineConfig({
resolve: {
alias: {
'@': path.resolve(__dirname, './src')
}
},
plugins: [
vue(),
VueSetupExtend()
// AutoImport({
// resolvers: [ElementPlusResolver()]
// }),
// Components({
// resolvers: [ElementPlusResolver()]
// }),
// importToCDN({
// prodUrl: 'https://unpkg.com/{name}@{version}/{path}',
// modules: [
// autoComplete('vue'),
// autoComplete('axios'),
// {
// name: 'element-plus',
// var: 'ElementPlus', //根据main.js中定义的来
// version: '2.2.17',
// path: 'dist/index.full.js',
// css: 'dist/index.css'
// },
// {
// name: 'moment',
// var: 'moment',
// version: '2.29.4',
// path: 'moment.js'
// },
// {
// name: 'echarts',
// var: 'echarts',
// version: '5.2.0',
// path: 'dist/echarts.min.js'
// },
// {
// name: 'echarts-gl',
// version: '2.0.8',
// path: 'dist/echarts-gl.min.js'
// },
// {
// name: 'mitt',
// version: '3.0.0',
// var: 'mitt',
// path: 'dist/mitt.js'
// },
// {
// name: 'moment',
// version: '2.29.4',
// var: 'mitt',
// path: 'dist/mitt.js'
// },
// {
// name: 'vue',
// version: '3.3.11',
// var: 'Vue',
// path: 'dist/vue.global.js'
// },
// {
// name: 'vue-router',
// version: '4.0.0',
// var: 'VueRouter',
// path: 'dist/vue-router.global.js'
// },
// {
// name: 'xlsx',
// version: '0.18.5',
// var: 'XLSX',
// path: 'dist/xlsx.full.min.js'
// }
// ]
// })
],
css: {
preprocessorOptions: {
less: {
javascriptEnabled: true,
additionalData: `@import "${path.resolve(__dirname, 'src/assets/less/variables.less')}";`
}
}
},
build: {
minify: 'terser',
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true
}
}
}
})