-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathvite.config.mts
More file actions
44 lines (43 loc) · 1.19 KB
/
vite.config.mts
File metadata and controls
44 lines (43 loc) · 1.19 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
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import tsconfigPaths from 'vite-tsconfig-paths';
export default defineConfig({
plugins: [react(), tsconfigPaths()],
server: {
port: 3001,
proxy: {
'/api': {
target: 'http://localhost:3000',
changeOrigin: false,
},
},
},
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler',
loadPaths: ['node_modules', '.'],
},
},
},
build: {
outDir: 'build',
sourcemap: true,
// Main app bundle remains ~1.8 MB until route-based lazy loading is implemented.
// Vendor libraries are already split into separate cached chunks below.
chunkSizeWarningLimit: 2000,
rollupOptions: {
output: {
manualChunks: {
'vendor-react': ['react', 'react-dom', 'react-router-dom'],
'vendor-hds': ['hds-react'],
'vendor-ol': ['ol'],
'vendor-chakra': ['@chakra-ui/react', 'framer-motion'],
'vendor-forms': ['react-hook-form', '@hookform/resolvers', 'yup'],
'vendor-query': ['react-query'],
'vendor-i18n': ['i18next', 'react-i18next'],
},
},
},
},
});