Build rework checkpoint

This commit is contained in:
Joseph Garrone
2024-06-10 07:57:12 +02:00
parent 9bbc7cc651
commit 84c774503d
13 changed files with 159 additions and 303 deletions

View File

@ -12,7 +12,7 @@ import { vitePluginSubScriptEnvNames } from "./constants";
export type BuildContext = {
bundler: "vite" | "webpack";
themeVersion: string;
themeNames: string[];
themeNames: [string, ...string[]];
extraThemeProperties: string[] | undefined;
groupId: string;
artifactId: string;
@ -147,7 +147,7 @@ export function getBuildContext(params: {
...resolvedViteConfig?.buildOptions
};
const themeNames = (() => {
const themeNames = ((): [string, ...string[]] => {
if (buildOptions.themeName === undefined) {
return [
parsedPackageJson.name
@ -161,7 +161,11 @@ export function getBuildContext(params: {
return [buildOptions.themeName];
}
return buildOptions.themeName;
const [mainThemeName, ...themeVariantNames] = buildOptions.themeName;
assert(mainThemeName !== undefined);
return [mainThemeName, ...themeVariantNames];
})();
const projectBuildDirPath = (() => {