mirror of https://github.com/aminya/setup-cpp
chore: add script for disabling debug messages in the release
This commit is contained in:
parent
da284e010c
commit
d82045ec40
19
.terserrc.js
19
.terserrc.js
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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
|
||||
})
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue