2022-01-23 09:41:18 +08:00
|
|
|
/* eslint-disable import/no-extraneous-dependencies */
|
2021-09-18 03:35:53 +08:00
|
|
|
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")
|
2023-04-02 07:32:43 +08:00
|
|
|
const file = join(dirname(__dirname), "dist", "setup-cpp.js")
|
2021-09-18 03:35:53 +08:00
|
|
|
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
|
|
|
|
})
|