-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
86 lines (75 loc) · 2.26 KB
/
vite.config.js
File metadata and controls
86 lines (75 loc) · 2.26 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import tailwindcss from '@tailwindcss/vite';
export default defineConfig({
build: {
chunkSizeWarningLimit: 600,
rollupOptions: {
output: {
entryFileNames: `js/[name].[hash].js`,
chunkFileNames: `js/[name].[hash].js`,
assetFileNames: `css/[name].[hash].[ext]`,
manualChunks(id) {
// Reihenfolge ist wichtig: Spezifische Module ZUERST prüfen!
// EditorJS und Plugins (große Library)
if (id.includes('node_modules/@editorjs') || id.includes('editorjs.js')) {
return 'editorjs';
}
// ApexCharts für Dashboard (nur dort benötigt)
if (id.includes('node_modules/apexcharts')) {
return 'charts';
}
// Alpine.js Core
if (id.includes('node_modules/@alpinejs') || id.includes('node_modules/alpinejs')) {
return 'alpine';
}
// Livewire
if (id.includes('node_modules/livewire')) {
return 'livewire';
}
// UI Libraries (Preline, etc.)
if (id.includes('node_modules/preline')) {
return 'ui';
}
// SortableJS (falls verwendet)
if (id.includes('node_modules/sortablejs')) {
return 'sortable';
}
// Projekt-spezifische Chunks
if (id.includes('/alpine/')) {
return 'alpine-components';
}
if (id.includes('./plugins/')) {
return 'plugins';
}
// Restliche node_modules
if (id.includes('node_modules')) {
return 'vendor';
}
}
},
external: ['preline', 'Sortable', 'Livewire', 'Alpine']
},
cssCodeSplit: true,
},
plugins: [
tailwindcss(),
laravel({
input: [
'resources/js/main.js',
'resources/js/alpine.js',
'resources/css/kompass.css'
],
buildDirectory: 'assets/build',
refresh: true,
}),
],
server: {
port: 5088,
// strictPort: true,
cors: true, // oder spezifische Optionen
hmr: {
host: 'localhost',
},
},
});