Performance: Preload für Haupt-Script mit fetchpriority=high

- Entry-Script wird mit hoher Priorität vorgeladen
- Schnellerer JavaScript-Download und Ausführung

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-05 23:25:03 +01:00
co-authored by Claude Opus 4.5
parent db6d969874
commit 3f32ad6081
+7
View File
@@ -22,6 +22,13 @@ function asyncCssPlugin(): Plugin {
html = html.replace(/<link rel="modulepreload" crossorigin href="\/assets\/js\/animations[^"]*\.js">\n?/g, '');
html = html.replace(/<link rel="modulepreload" crossorigin href="\/assets\/js\/icons[^"]*\.js">\n?/g, '');
// Add high priority preload for entry script
const mainScriptMatch = html.match(/<script type="module" crossorigin src="(\/assets\/js\/index-[^"]+\.js)">/);
if (mainScriptMatch) {
const preloadScript = `<link rel="preload" href="${mainScriptMatch[1]}" as="script" crossorigin fetchpriority="high">\n`;
html = html.replace('</title>', '</title>\n ' + preloadScript);
}
return html;
}
};