fix(build): create random hash for cache invalidation #209

This commit is contained in:
Bastian Ike
2022-09-13 13:49:32 +02:00
committed by Bastian
parent 5e0158c2ff
commit af9d7c8706
3 changed files with 16 additions and 6 deletions

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env node
import { spawn } from "child_process";
import { randomBytes } from "crypto";
import * as fs from "fs-extra";
import * as paths from "./paths";
@@ -23,7 +24,11 @@ const runCommand = (command: string) =>
const executedCommand = spawn(command, {
stdio: "inherit",
shell: true,
env: { REACT_APP_RADAR_NAME: "AOE Technology Radar", ...process.env },
env: {
REACT_APP_RADAR_NAME: "AOE Technology Radar",
REACT_APP_BUILDHASH: randomBytes(10).toString("hex"),
...process.env,
},
});
executedCommand.on("error", (error) => {