complete performance and reliability follow-ups
This commit is contained in:
@@ -19,6 +19,7 @@ import {
|
||||
} from "@wrnexus/csr";
|
||||
import {
|
||||
renderStyles,
|
||||
renderActiveThemeCss,
|
||||
renderThemeCss,
|
||||
renderThemeRuntime,
|
||||
type ResolvedTheme,
|
||||
@@ -122,6 +123,18 @@ export function createDevAssetServer(
|
||||
? cssResponse(renderThemeCss(theme))
|
||||
: new Response("Not Found", { status: 404 });
|
||||
}
|
||||
const activeThemeMatch = /^\/__wrnexus\/theme\/([^/]+)\/([^/]+)\.css$/.exec(pathname);
|
||||
if (activeThemeMatch && theme) {
|
||||
try {
|
||||
const themeName = decodeURIComponent(activeThemeMatch[1]!);
|
||||
const accentPart = decodeURIComponent(activeThemeMatch[2]!);
|
||||
return cssResponse(
|
||||
renderActiveThemeCss(theme, themeName, accentPart === "_" ? undefined : accentPart),
|
||||
);
|
||||
} catch {
|
||||
return new Response("Not Found", { status: 404 });
|
||||
}
|
||||
}
|
||||
if (pathname === "/__wrnexus/theme.js") {
|
||||
return theme
|
||||
? jsResponse(renderThemeRuntime(theme))
|
||||
|
||||
Reference in New Issue
Block a user