-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
59 lines (59 loc) · 1.36 KB
/
vite.config.ts
File metadata and controls
59 lines (59 loc) · 1.36 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
import path from 'path'
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
export default defineConfig({
plugins: [
react()
],
clearScreen: false,
server: {
port: 1420,
strictPort: true,
},
envPrefix: ["VITE_", "TAURI_"],
publicDir: 'src/public',
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
build: {
// Production optimizations
minify: 'terser',
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true,
pure_funcs: ['console.log', 'console.info', 'console.debug', 'console.warn'],
// Additional compression
passes: 3,
unsafe: true,
unsafe_comps: true,
unsafe_Function: true,
unsafe_math: true,
unsafe_proto: true,
unsafe_regexp: true,
unsafe_undefined: true,
},
mangle: {
toplevel: true,
properties: false
},
format: {
comments: false,
beautify: false,
}
},
// Additional security: remove source maps in production
sourcemap: false,
// Optimize chunk size
rollupOptions: {
output: {
manualChunks: {
vendor: ['react', 'react-dom'],
ui: ['@radix-ui/react-dialog', '@radix-ui/react-dropdown-menu', '@radix-ui/react-tabs'],
}
}
}
},
});