diff --git a/src/bin/shared/buildContext.ts b/src/bin/shared/buildContext.ts index ecda7e46..9dd340e5 100644 --- a/src/bin/shared/buildContext.ts +++ b/src/bin/shared/buildContext.ts @@ -137,6 +137,7 @@ export function getBuildContext(params: { const parsedPackageJson = (() => { type BuildOptions_packageJson = BuildOptions & { projectBuildDirPath?: string; + staticDirPathInBuildDirPath?: string; }; type ParsedPackageJson = { @@ -169,6 +170,7 @@ export function getBuildContext(params: { ) .optional(), themeName: z.union([z.string(), z.array(z.string())]).optional(), + staticDirPathInBuildDirPath: z.string().optional(), keycloakVersionTargets: id< z.ZodType >( @@ -229,7 +231,7 @@ export function getBuildContext(params: { ); })(); - const buildOptions: BuildOptions = { + const buildOptions = { ...parsedPackageJson.keycloakify, ...resolvedViteConfig?.buildOptions }; @@ -309,9 +311,9 @@ export function getBuildContext(params: { break webpack; } - if (parsedPackageJson.keycloakify?.projectBuildDirPath !== undefined) { + if (buildOptions.projectBuildDirPath !== undefined) { return getAbsoluteAndInOsFormatPath({ - pathIsh: parsedPackageJson.keycloakify.projectBuildDirPath, + pathIsh: buildOptions.projectBuildDirPath, cwd: projectDirPath }); } @@ -438,6 +440,13 @@ export function getBuildContext(params: { break webpack; } + if (buildOptions.staticDirPathInBuildDirPath !== undefined) { + getAbsoluteAndInOsFormatPath({ + pathIsh: buildOptions.staticDirPathInBuildDirPath, + cwd: projectBuildDirPath + }); + } + return pathJoin(projectBuildDirPath, "static"); }