This repository was archived by the owner on Dec 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathvite.config.ts
More file actions
43 lines (41 loc) · 1.33 KB
/
Copy pathvite.config.ts
File metadata and controls
43 lines (41 loc) · 1.33 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
import {defineConfig} from 'vite';
import react from '@vitejs/plugin-react-swc';
import viteCompression from 'vite-plugin-compression';
// https://vitejs.dev/config/
export default defineConfig(({command}) => {
const base = command === 'build' ? '/Enhance-for-Skland/' : '/';
return {
plugins: [react(), viteCompression({
verbose: true,
disable: false,
threshold: 102400,
algorithm: 'gzip',
ext: '.gz'
})],
build: {
cssCodeSplit: true,
sourcemap: false,
rollupOptions: {
output: {
assetFileNames: 'static/[ext]/[hash].[ext]',
chunkFileNames: 'static/js/[hash].js',
entryFileNames: 'static/js/[hash].js',
manualChunks: (id: any): string => {
if (id.includes('node_modules')) {
return id.split('node_modules/')[1].split('/')[0];
}
}
}
},
minify: 'terser',
cssMinify: 'lightningcss',
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true
}
}
},
base
};
});