refactor: streamline SSR setup and remove Babel configuration

- Updated import path for app.server module in SSR hook.
- Removed babel.config.server.json as Babel is no longer needed for async/await transformation.
- Adjusted esbuild configuration to target ESNext and modified output paths.
- Enhanced App.svelte to handle initial content loading during SSR.
- Updated SSR script to load messages synchronously before rendering.
- Simplified build:server script in package.json by removing Babel step.
This commit is contained in:
2026-05-12 15:47:53 +00:00
parent e84b87ed16
commit 4a604bab0b
9 changed files with 11844 additions and 51 deletions
+13
View File
@@ -213,8 +213,21 @@
loading = false
}
if (typeof window === "undefined") {
;(() => {
const initialPath = url.split("?")[0] || "/"
const initialLang = extractLanguageFromPath(initialPath) || DEFAULT_LANGUAGE
const initialRoutePath = stripLanguageFromPath(initialPath) || "/"
loadContent(initialLang, initialRoutePath)
})()
}
// Re-load content when path or language changes
$effect(() => {
if (typeof window === "undefined") {
return
}
const lang = $currentLanguage
const routePath = stripLanguageFromPath($location.path)
loadContent(lang, routePath || "/")