perf: optimize bundle size and add build optimizations
All checks were successful
CI / update (push) Successful in 1m23s
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
This commit is contained in:
@@ -1,4 +1,19 @@
|
||||
import { redirect, error } from '@sveltejs/kit';
|
||||
import { stripHtmlTags } from '$lib/js/stripHtmlTags';
|
||||
|
||||
export async function load({ parent }) {
|
||||
// Get data from universal load function
|
||||
const data = await parent();
|
||||
|
||||
// Strip HTML tags server-side to avoid bundling cheerio in client
|
||||
const strippedName = stripHtmlTags(data.name);
|
||||
const strippedDescription = stripHtmlTags(data.description);
|
||||
|
||||
return {
|
||||
strippedName,
|
||||
strippedDescription,
|
||||
};
|
||||
}
|
||||
|
||||
export const actions = {
|
||||
toggleFavorite: async ({ request, locals, url, fetch }) => {
|
||||
|
||||
Reference in New Issue
Block a user