Add publicDirpath option for webpack
This commit is contained in:
@ -139,6 +139,7 @@ export function getBuildContext(params: {
|
|||||||
type BuildOptions_packageJson = BuildOptions & {
|
type BuildOptions_packageJson = BuildOptions & {
|
||||||
projectBuildDirPath?: string;
|
projectBuildDirPath?: string;
|
||||||
staticDirPathInProjectBuildDirPath?: string;
|
staticDirPathInProjectBuildDirPath?: string;
|
||||||
|
publicDirPath?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
type ParsedPackageJson = {
|
type ParsedPackageJson = {
|
||||||
@ -173,6 +174,7 @@ export function getBuildContext(params: {
|
|||||||
themeName: z.union([z.string(), z.array(z.string())]).optional(),
|
themeName: z.union([z.string(), z.array(z.string())]).optional(),
|
||||||
themeVersion: z.string().optional(),
|
themeVersion: z.string().optional(),
|
||||||
staticDirPathInProjectBuildDirPath: z.string().optional(),
|
staticDirPathInProjectBuildDirPath: z.string().optional(),
|
||||||
|
publicDirPath: z.string().optional(),
|
||||||
keycloakVersionTargets: id<
|
keycloakVersionTargets: id<
|
||||||
z.ZodType<BuildOptions.KeycloakVersionTargets>
|
z.ZodType<BuildOptions.KeycloakVersionTargets>
|
||||||
>(
|
>(
|
||||||
@ -377,14 +379,21 @@ export function getBuildContext(params: {
|
|||||||
);
|
);
|
||||||
})(),
|
})(),
|
||||||
publicDirPath: (() => {
|
publicDirPath: (() => {
|
||||||
|
if (process.env.PUBLIC_DIR_PATH !== undefined) {
|
||||||
|
return getAbsoluteAndInOsFormatPath({
|
||||||
|
pathIsh: process.env.PUBLIC_DIR_PATH,
|
||||||
|
cwd: projectDirPath
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
webpack: {
|
webpack: {
|
||||||
if (resolvedViteConfig !== undefined) {
|
if (resolvedViteConfig !== undefined) {
|
||||||
break webpack;
|
break webpack;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.env.PUBLIC_DIR_PATH !== undefined) {
|
if (buildOptions.publicDirPath !== undefined) {
|
||||||
return getAbsoluteAndInOsFormatPath({
|
return getAbsoluteAndInOsFormatPath({
|
||||||
pathIsh: process.env.PUBLIC_DIR_PATH,
|
pathIsh: buildOptions.publicDirPath,
|
||||||
cwd: projectDirPath
|
cwd: projectDirPath
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user