All checks were successful
CI / update (push) Successful in 1m23s
- Move HTML stripping to server-side to remove cheerio from client bundle (247KB reduction) - Add terser minification with console/debugger removal - Enable manual code chunking for chart.js and auth libraries - Convert TTF fonts to WOFF2 format (~900KB savings) - Enable brotli/gzip precompression in adapter - Update CSS to prefer WOFF2 with TTF fallback
34 lines
638 B
TypeScript
34 lines
638 B
TypeScript
import { sveltekit } from '@sveltejs/kit/vite';
|
|
import { defineConfig } from 'vite';
|
|
|
|
export default defineConfig({
|
|
server: {
|
|
allowedHosts: ["bocken.org"]
|
|
},
|
|
plugins: [sveltekit()],
|
|
build: {
|
|
minify: 'terser',
|
|
terserOptions: {
|
|
compress: {
|
|
drop_console: true,
|
|
drop_debugger: true
|
|
}
|
|
},
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks: (id) => {
|
|
// Separate large dependencies into their own chunks
|
|
if (id.includes('node_modules')) {
|
|
if (id.includes('chart.js')) {
|
|
return 'chart';
|
|
}
|
|
if (id.includes('@auth/sveltekit')) {
|
|
return 'auth';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|