Fix bug package.json not properly updated when initializing the single page account theme with webpack

This commit is contained in:
Joseph Garrone 2024-08-28 17:08:11 +02:00
parent 8203ed687b
commit 6bfd388827

View File

@ -75,17 +75,22 @@ export function updateAccountThemeImplementationInConfig(params: {
return id<z.ZodType<TargetType>>(zTargetType);
})();
return zParsedPackageJson.parse(
JSON.parse(
fs
.readFileSync(buildContext.packageJsonFilePath)
.toString("utf8")
)
const parsedPackageJson = JSON.parse(
fs.readFileSync(buildContext.packageJsonFilePath).toString("utf8")
);
zParsedPackageJson.parse(parsedPackageJson);
return parsedPackageJson;
})();
parsedPackageJson.keycloakify.accountThemeImplementation =
accountThemeType;
fs.writeFileSync(
buildContext.packageJsonFilePath,
Buffer.from(JSON.stringify(parsedPackageJson, undefined, 4), "utf8")
);
}
break;
}