Repository navigation
Expand file tree
/
Copy pathvite.config.js
More file actions
90 lines (89 loc) · 2.41 KB
/
Copy pathvite.config.js
File metadata and controls
90 lines (89 loc) · 2.41 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
/*
* @FilePath: \maggot-design\vite.config.js
* @Author: maggot-code
* @Date: 2022-07-23 23:29:33
* @LastEditors: maggot-code
* @LastEditTime: 2022-10-24 18:12:53
* @Description:
*/
import { defineConfig, splitVendorChunkPlugin } from 'vite';
import vue from '@vitejs/plugin-vue2';
// import legacy from '@vitejs/plugin-legacy';
import viteComperssion from 'vite-plugin-compression';
import viteComponents from 'unplugin-vue-components/vite';
// import { ElementUiResolver } from 'unplugin-vue-components/resolvers';
import { visualizer } from 'rollup-plugin-visualizer';
import commonjs from 'vite-plugin-commonjs';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
commonjs(),
splitVendorChunkPlugin(),
// legacy({
// targets: ['defaults', 'not ie < 9'],
// }),
viteComperssion({
verbose: true,
disable: false,
threshold: 10240,
algorithm: 'gzip',
ext: '.gz',
deleteOriginFile: false,
}),
viteComponents({
// resolvers: [
// // ElementUiResolver({
// // importStyle: 'css',
// // }),
// ElementUiResolver(),
// ],
dirs: [
'src/component',
'src/composable',
'src/layout',
'src/pages',
],
extensions: ['vue', 'tsx'],
transformer: 'vue2',
dts: true,
deep: true,
}),
visualizer({
filename: './node_modules/.cache/visualizer/stats.html',
open: true,
gzipSize: true,
brotliSize: true,
}),
],
// css: {
// preprocessorOptions: {
// scss: {
// api: 'modern',
// // silenceDeprecations: ['import'],
// },
// },
// },
// build: {
// rollupOptions: {
// output: {
// manualChunks: {
// 'element-ui': ['element-ui'],
// },
// },
// },
// },
// server: {
// hmr: {
// overlay: false,
// },
// },
optimizeDeps: {
include: ['node_modules/maggot-form/lib/maggot-form.common.js'],
},
resolve: {
alias: {
'@': '/src',
},
},
});