293333056f
Closes #24863 Signed-off-by: Jon Koops <jonkoops@gmail.com>
17 lines
483 B
JavaScript
17 lines
483 B
JavaScript
import fs from "node:fs/promises";
|
|
import path from "node:path";
|
|
|
|
const targetDir = "target/classes/theme/keycloak/common/resources/vendor";
|
|
|
|
replaceContents(
|
|
path.join(targetDir, "react/react-jsx-runtime.production.min.js"),
|
|
'"./react.production.min.js"',
|
|
'"react"',
|
|
);
|
|
|
|
async function replaceContents(filePath, search, replace) {
|
|
const file = await fs.readFile(filePath, "utf8");
|
|
const newFile = file.replace(search, replace);
|
|
|
|
await fs.writeFile(filePath, newFile);
|
|
}
|