All checks were successful
CI / update (push) Successful in 1m22s
Changed drop_console from true to ['log', 'debug'] to retain error and warning logs for debugging while reducing bundle size.
34 lines
650 B
TypeScript
34 lines
650 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: ['log', 'debug'],
|
|
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';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|