-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
71 lines (70 loc) · 1.43 KB
/
vite.config.ts
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
import { resolve } from 'node:path'
import vue from '@vitejs/plugin-vue'
import autoprefixer from 'autoprefixer'
import tailwind from 'tailwindcss'
import { defineConfig } from 'vite'
export default defineConfig({
css: {
postcss: {
plugins: [tailwind(), autoprefixer()],
},
devSourcemap: false,
},
plugins: [vue()],
resolve: {
alias: {
'@': resolve('./src')
}
},
build: {
target: 'esnext',
minify: 'terser',
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true,
pure_funcs: ['console.log', 'console.info'],
passes: 2
},
format: {
comments: false,
preserve_annotations: false
},
mangle: {
toplevel: true
}
},
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('node_modules')) {
if (id.includes('vue')) {
return 'vue-core';
}
if (id.includes('@vueuse')) {
return 'vue-use';
}
if (id.includes('radix-vue')) {
return 'radix';
}
return 'vendors';
}
}
}
},
assetsInlineLimit: 4096,
sourcemap: false,
cssCodeSplit: true,
modulePreload: {
polyfill: true
}
},
server: {
hmr: {
overlay: false
}
},
optimizeDeps: {
include: ['@/composables/useFont']
}
})