webpack/tooling/decode-debug-hash.js

13 lines
268 B
JavaScript
Raw Permalink Normal View History

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