complete performance and reliability follow-ups

This commit is contained in:
2026-08-09 23:04:36 +05:30
parent 8f19a5eb2b
commit 232d8e6734
31 changed files with 525 additions and 726 deletions
+15
View File
@@ -44,6 +44,7 @@ import {
bundleCss,
renderStyles,
resolveThemeConfig,
renderActiveThemeCss,
renderThemeCss,
renderThemeRuntime,
} from "@wrnexus/styles";
@@ -497,6 +498,19 @@ export async function runBuild(appRoot: string): Promise<void> {
const themeJs = renderThemeRuntime(theme);
writeFileSync(join(distDir, "theme.css"), themeCss, "utf8");
writeFileSync(join(distDir, "theme.js"), themeJs, "utf8");
const themeAssetsDir = join(distDir, "theme");
for (const themeName of theme.names) {
const themeDir = join(themeAssetsDir, encodeURIComponent(themeName));
mkdirSync(themeDir, { recursive: true });
writeFileSync(join(themeDir, "_.css"), renderActiveThemeCss(theme, themeName), "utf8");
for (const accentName of theme.accentNames) {
writeFileSync(
join(themeDir, `${encodeURIComponent(accentName)}.css`),
renderActiveThemeCss(theme, themeName, accentName),
"utf8",
);
}
}
assetHash.update(themeCss);
assetHash.update(themeJs);
console.log(`✓ Theme: ${theme.names.length} themes (default: ${theme.default})`);
@@ -709,6 +723,7 @@ await createProductionServer(
controllersPath: join(import.meta.dir, "controllers.js"),
clientModulesDir: join(import.meta.dir, "client"),
themePath: join(import.meta.dir, "theme.css"),
themeAssetsDir: join(import.meta.dir, "theme"),
themeJsPath: join(import.meta.dir, "theme.js"),
theme: ${JSON.stringify(theme)},
uiCssPath: join(import.meta.dir, "ui.css"),