-
Notifications
You must be signed in to change notification settings - Fork 4
/
vite.config.ts
62 lines (61 loc) · 1.86 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
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
import svgr from 'vite-plugin-svgr';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), svgr()],
build: {
sourcemap: false,
rollupOptions: {
output: {
manualChunks: {
react: ['react'],
router: ['react-router-dom'],
dom: ['react-dom'],
style: ['@emotion/react', '@emotion/styled'],
fetch: ['axios'],
state: ['@tanstack/react-query', 'zustand'],
map: ['react-kakao-maps-sdk'],
socket: ['sockjs-client', 'stompjs'],
form: ['react-hook-form'],
ui: [
'react-hot-toast',
'react-draggable-bottom-sheet',
'react-calendar',
],
},
},
},
},
server: {
proxy: {
'/api': {
target: process.env.VITE_BASE_URL,
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
},
},
},
resolve: {
alias: [
{ find: '@', replacement: '/src' },
{ find: '@api', replacement: '/src/api' },
{ find: '@pages', replacement: '/src/pages' },
{ find: '@routes', replacement: '/src/routes' },
{ find: '@components', replacement: '/src/components' },
{ find: '@hooks', replacement: '/src/hooks' },
{ find: '@styles', replacement: '/src/styles' },
{ find: '@stores', replacement: '/src/stores' },
{ find: '@contexts', replacement: '/src/contexts' },
{ find: '@type', replacement: '/src/type' },
{ find: '@constants', replacement: '/src/constants' },
{ find: '@utils', replacement: '/src/utils' },
{ find: '@assets', replacement: '/src/assets' },
{ find: '@tests', replacement: '/src/tests' },
{ find: '@mocks', replacement: '/src/mocks' },
],
},
define: {
global: 'window',
},
});