chore: add script for disabling debug messages in the release

This commit is contained in:
Amin Yahyaabadi 2021-09-17 14:35:53 -05:00
parent da284e010c
commit d82045ec40
4 changed files with 36 additions and 4 deletions

View File

@ -1 +1,18 @@
module.exports = require("terser-config-atomic")
const terserConfig = require("terser-config-atomic")
const compress =
typeof terserConfig.compress !== "boolean"
? {
...terserConfig.compress,
global_defs: {
...terserConfig.compress.global_defs,
"process.env.NODE_DEBUG": false,
"process.env.RUNNER_DEBUG": "0",
},
}
: terserConfig.compress
module.exports = {
...terserConfig,
compress,
}

16
building/debug_remove.js Normal file
View File

@ -0,0 +1,16 @@
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
})

3
dist/setup_cpp.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long