-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
41 lines (40 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
import { defineConfig } from "vite"
export default defineConfig({
// clearScreen: false,
server: {
port: 5000,
strictPort: true
},
root: './src',
publicDir: '../public', // relative to viteConfig.root directory
build: {
outDir: '../dist',
emptyOutDir: true,
target: 'es2022', // ES2022 allowed for terser v5.16+ https://github.com/vitejs/vite/pull/12197
minify: 'terser',
terserOptions: {
format: {
comments: false
},
compress: {
pure_getters: true,
keep_fargs: false,
unsafe: true,
unsafe_arrows: true,
unsafe_comps: true,
unsafe_Function: true,
unsafe_math: true,
unsafe_symbols: true,
unsafe_methods: true,
unsafe_proto: true,
unsafe_undefined: true,
passes: 3,
},
// mangle: true
mangle: {
properties: 'keep_quoted', // effective but dangerous?
},
},
},
plugins: []
})