forked from dataease/SQLBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
70 lines (69 loc) · 1.58 KB
/
Copy pathvite.config.ts
File metadata and controls
70 lines (69 loc) · 1.58 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
import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components-secondary/vite'
import { ElementPlusResolver } from 'unplugin-vue-components-secondary/resolvers'
import path from 'path'
import svgLoader from 'vite-svg-loader'
import legacy from '@vitejs/plugin-legacy'
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd())
console.info(mode)
console.info(env)
return {
base: './',
plugins: [
vue(),
AutoImport({
resolvers: [ElementPlusResolver()],
eslintrc: {
enabled: false,
},
}),
Components({
resolvers: [ElementPlusResolver()],
}),
svgLoader({
svgo: false,
defaultImport: 'component', // or 'raw'
}),
legacy({
targets: ['Chrome >= 81'],
polyfills: true,
modernPolyfills: true,
}),
],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
css: {
preprocessorOptions: {
less: {
javascriptEnabled: true,
},
},
},
build: {
target: 'chrome81',
chunkSizeWarningLimit: 2000,
rollupOptions: {
output: {
manualChunks: {
'element-plus-secondary': ['element-plus-secondary'],
},
},
},
},
optimizeDeps: {
esbuildOptions: {
target: 'chrome81',
},
},
esbuild: {
jsxFactory: 'h',
jsxFragment: 'Fragment',
},
}
})