Template
1
0
mirror of https://github.com/aminya/setup-cpp synced 2024-11-30 21:22:30 +08:00
setup-cpp/building/scripts/debug_remove.js
2022-01-22 17:41:18 -08:00

18 lines
570 B
JavaScript

/* eslint-disable import/no-extraneous-dependencies */
const { minify } = require("terser")
const { readFileSync, writeFileSync } = require("fs")
const { join, dirname } = require("path")
async function main() {
console.log("Disabling debug messages inside @actions/core")
const file = join(dirname(__dirname), "dist", "setup_cpp.js")
const { code, map } = await minify(readFileSync(file, "utf8"), { sourceMap: true, ...require("../.terserrc.js") })
writeFileSync(file, code)
writeFileSync(`${file}.map`, map)
}
main().catch(function (err) {
throw err
})