-
-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy pathvite.config.js
More file actions
63 lines (58 loc) 路 1.98 KB
/
Copy pathvite.config.js
File metadata and controls
63 lines (58 loc) 路 1.98 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
60
61
62
63
import tailwindcss from '@tailwindcss/vite';
import react from '@vitejs/plugin-react';
import laravel from 'laravel-vite-plugin';
import { resolve } from 'node:path';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [
laravel({
input: ['resources/css/app.css', 'resources/js/app.tsx'],
ssr: 'resources/js/ssr.tsx',
refresh: true,
}),
react(),
tailwindcss(),
],
esbuild: {
jsx: 'automatic',
},
resolve: {
alias: {
'ziggy-js': resolve(__dirname, 'vendor/tightenco/ziggy'),
},
},
build: {
// Disable source maps to reduce memory usage
sourcemap: false,
// Increase chunk size warning limit
chunkSizeWarningLimit: 1000,
// Optimize chunk splitting
rollupOptions: {
output: {
manualChunks: {
// Split vendor chunks
'react-vendor': ['react', 'react-dom'],
'inertia-vendor': ['@inertiajs/react'],
'ui-vendor': [
'@radix-ui/react-avatar',
'@radix-ui/react-dialog',
'@radix-ui/react-dropdown-menu',
'@radix-ui/react-popover',
'@radix-ui/react-label',
'@radix-ui/react-select',
'@radix-ui/react-separator',
'@radix-ui/react-slot',
'@radix-ui/react-tabs',
'@radix-ui/react-tooltip',
],
'chart-vendor': ['chart.js', 'react-chartjs-2'],
'date-vendor': ['date-fns', 'react-day-picker'],
},
},
},
// Reduce memory usage
minify: 'esbuild',
// Target modern browsers to reduce transformations
target: 'es2020',
},
});