-
Notifications
You must be signed in to change notification settings - Fork 4
/
vite.config.ts
66 lines (65 loc) · 1.84 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
import react from '@vitejs/plugin-react-swc';
import path from 'path';
import { defineConfig } from 'vite';
import { compression } from 'vite-plugin-compression2';
// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@assets': path.resolve(__dirname, './src/assets'),
'@components': path.resolve(__dirname, './src/components'),
'@constants': path.resolve(__dirname, './src/constants'),
'@hooks': path.resolve(__dirname, './src/hooks'),
'@pages': path.resolve(__dirname, './src/pages'),
'@stores': path.resolve(__dirname, './src/stores'),
'@styles': path.resolve(__dirname, './src/styles'),
'@types': path.resolve(__dirname, './src/types'),
'@utils': path.resolve(__dirname, './src/utils'),
},
},
plugins: [
react(),
compression({
algorithm: 'gzip',
}),
compression({
algorithm: 'brotliCompress',
}),
],
build: {
minify: 'terser',
rollupOptions: {
output: {
manualChunks: (id: string) => {
if (id.includes('node_modules')) {
if (id.includes('lodash')) {
return 'lodash-vendor';
}
if (id.includes('axios')) {
return 'axios-vendor';
}
if (id.includes('sentry')) {
return 'sentry-vendor';
}
if (id.includes('react-hook-form')) {
return 'react-hook-form-vendor';
}
if (id.includes('react-beautiful-dnd')) {
return 'react-beautiful-dnd-vendor';
}
}
},
},
},
},
server: {
proxy: {
'/api': {
target: 'https://api.kiwing.kr/api/v1',
rewrite: (path) => path.replace(/^\/api/, ''),
changeOrigin: true,
},
},
},
});