complete performance and reliability follow-ups
This commit is contained in:
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user