Complete build option

This commit is contained in:
Joseph Garrone
2024-01-30 06:55:26 +01:00
parent 5a57bb59e5
commit 7c7ce159fe
6 changed files with 111 additions and 82 deletions

View File

@ -5,7 +5,7 @@ import { z } from "zod";
import { join as pathJoin } from "path";
import { resolvedViteConfigJsonBasename } from "../../constants";
import type { OptionalIfCanBeUndefined } from "../../tools/OptionalIfCanBeUndefined";
import { getAbsoluteAndInOsFormatPath } from "../../tools/getAbsoluteAndInOsFormatPath";
import { getKeycloakifyBuildDirPath } from "./getKeycloakifyBuildDirPath";
export type ResolvedViteConfig = {
buildDir: string;
@ -83,34 +83,3 @@ export function readResolvedViteConfig(params: {
return { resolvedViteConfig };
}
export function getKeycloakifyBuildDirPath(params: {
reactAppRootDirPath: string;
parsedPackageJson_keycloakify_keycloakifyBuildDirPath: string | undefined;
bundler: "vite" | "webpack";
}) {
const { reactAppRootDirPath, parsedPackageJson_keycloakify_keycloakifyBuildDirPath, bundler } = params;
const keycloakifyBuildDirPath = (() => {
if (parsedPackageJson_keycloakify_keycloakifyBuildDirPath !== undefined) {
getAbsoluteAndInOsFormatPath({
"pathIsh": parsedPackageJson_keycloakify_keycloakifyBuildDirPath,
"cwd": reactAppRootDirPath
});
}
return pathJoin(
reactAppRootDirPath,
`${(() => {
switch (bundler) {
case "vite":
return "dist";
case "webpack":
return "build";
}
})()}_keycloak`
);
})();
return { keycloakifyBuildDirPath };
}