43 lines
1.0 KiB
TypeScript
43 lines
1.0 KiB
TypeScript
import tailwindcss from '@tailwindcss/vite';
|
|
import { sveltekit } from '@sveltejs/kit/vite';
|
|
import { defineConfig } from 'vite';
|
|
|
|
export default defineConfig({
|
|
plugins: [tailwindcss(), sveltekit()],
|
|
optimizeDeps: {
|
|
// Pre-bundle heavy deps to avoid dev slowdowns
|
|
include: [
|
|
'libphonenumber-js',
|
|
'country-state-city',
|
|
'phosphor-svelte',
|
|
'@internationalized/date'
|
|
],
|
|
// Exclude problematic deps from pre-bundling
|
|
exclude: ['moment']
|
|
},
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks(id) {
|
|
// Split heavy phone/location libraries
|
|
if (id.includes('libphonenumber-js') || id.includes('country-state-city')) {
|
|
return 'vendor-phone';
|
|
}
|
|
// Split Phosphor icons (likely heavy)
|
|
if (id.includes('phosphor-svelte')) {
|
|
return 'vendor-icons';
|
|
}
|
|
// Split moment if used
|
|
if (id.includes('moment')) {
|
|
return 'vendor-date';
|
|
}
|
|
// Group other vendor libraries
|
|
if (id.includes('node_modules')) {
|
|
return 'vendor';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|