Enable to use an other directory than build/assets in webpack
This commit is contained in:
parent
327e4d1f90
commit
2a6e9af9c9
@ -137,6 +137,7 @@ export function getBuildContext(params: {
|
|||||||
const parsedPackageJson = (() => {
|
const parsedPackageJson = (() => {
|
||||||
type BuildOptions_packageJson = BuildOptions & {
|
type BuildOptions_packageJson = BuildOptions & {
|
||||||
projectBuildDirPath?: string;
|
projectBuildDirPath?: string;
|
||||||
|
staticDirPathInBuildDirPath?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
type ParsedPackageJson = {
|
type ParsedPackageJson = {
|
||||||
@ -169,6 +170,7 @@ export function getBuildContext(params: {
|
|||||||
)
|
)
|
||||||
.optional(),
|
.optional(),
|
||||||
themeName: z.union([z.string(), z.array(z.string())]).optional(),
|
themeName: z.union([z.string(), z.array(z.string())]).optional(),
|
||||||
|
staticDirPathInBuildDirPath: z.string().optional(),
|
||||||
keycloakVersionTargets: id<
|
keycloakVersionTargets: id<
|
||||||
z.ZodType<BuildOptions.KeycloakVersionTargets>
|
z.ZodType<BuildOptions.KeycloakVersionTargets>
|
||||||
>(
|
>(
|
||||||
@ -229,7 +231,7 @@ export function getBuildContext(params: {
|
|||||||
);
|
);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
const buildOptions: BuildOptions = {
|
const buildOptions = {
|
||||||
...parsedPackageJson.keycloakify,
|
...parsedPackageJson.keycloakify,
|
||||||
...resolvedViteConfig?.buildOptions
|
...resolvedViteConfig?.buildOptions
|
||||||
};
|
};
|
||||||
@ -309,9 +311,9 @@ export function getBuildContext(params: {
|
|||||||
break webpack;
|
break webpack;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parsedPackageJson.keycloakify?.projectBuildDirPath !== undefined) {
|
if (buildOptions.projectBuildDirPath !== undefined) {
|
||||||
return getAbsoluteAndInOsFormatPath({
|
return getAbsoluteAndInOsFormatPath({
|
||||||
pathIsh: parsedPackageJson.keycloakify.projectBuildDirPath,
|
pathIsh: buildOptions.projectBuildDirPath,
|
||||||
cwd: projectDirPath
|
cwd: projectDirPath
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -438,6 +440,13 @@ export function getBuildContext(params: {
|
|||||||
break webpack;
|
break webpack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (buildOptions.staticDirPathInBuildDirPath !== undefined) {
|
||||||
|
getAbsoluteAndInOsFormatPath({
|
||||||
|
pathIsh: buildOptions.staticDirPathInBuildDirPath,
|
||||||
|
cwd: projectBuildDirPath
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return pathJoin(projectBuildDirPath, "static");
|
return pathJoin(projectBuildDirPath, "static");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user