webpack/tooling/decode-debug-hash.js

11 lines
255 B
JavaScript
Raw Normal View History

const fs = require("fs");
const file = process.argv[2];
let content = fs.readFileSync(file, "utf-8");
2024-07-31 11:31:11 +08:00
content = content.replace(/debug-digest-([a-f0-9]+)/g, (match, bin) =>
Buffer.from(bin, "hex").toString("utf-8")
);
fs.writeFileSync(file, content);