-
Notifications
You must be signed in to change notification settings - Fork 4
/
vite.config.js
43 lines (41 loc) · 1.15 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
import vue from '@vitejs/plugin-vue';
import path from 'path';
import { defineConfig } from 'vite';
import { vitePluginForArco } from '@arco-plugins/vite-vue';
export default defineConfig({
base: './',
build: {
minify: 'terser',
rollupOptions: {
output: {
manualChunks: (id) => {
if (id.includes('node_modules')) return 'vendor';
},
chunkFileNames: 'assets/js/[name]-[hash].js',
entryFileNames: 'assets/js/[name]-[hash].js',
assetFileNames: (assetInfo) => {
if (assetInfo.name && assetInfo.name.endsWith('.ico')) return '[name].[ext]';
return 'assets/[ext]/[name]-[hash].[ext]';
}
}
},
terserOptions: {
compress: {
drop_console: false,
drop_debugger: true
}
}
},
plugins: [
vue(),
vitePluginForArco({
style: 'css'
})
],
resolve: {
alias: {
'@': path.resolve(__dirname, 'src')
}
},
logLevel: 'error'
});