zyd-server-build2 1.0.20 → 1.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/index.js +4 -2
- package/package.json +1 -1
package/README.md
CHANGED
package/index.js
CHANGED
|
@@ -81,7 +81,7 @@ async function build({ src, dst, ignoreDir = [], ignoreFile = [], copyright = ""
|
|
|
81
81
|
keep_fnames: true, // 默认 false。传 true来防止压缩器干掉函数名。对那些依赖
|
|
82
82
|
toplevel: false
|
|
83
83
|
})
|
|
84
|
-
await fs.writeFileSync(_dst, (copyright ? "/* " + copyright + " */" : "") + result.code)
|
|
84
|
+
await fs.writeFileSync(_dst, (copyright ? "/* " + copyright + " */" : "") + result.code + (copyright ? `var _${generateComplexRandomString(5)}="${btoa(copyright.toString() + new Date().getFullYear() + "-" + (new Date().getUTCMonth() + 1) + "-" + new Date().getUTCDate() + "T" + new Date().getHours() + ":" + new Date().getMinutes() + ":" + new Date().getSeconds())}";` : ""))
|
|
85
85
|
count[1]++
|
|
86
86
|
}
|
|
87
87
|
} else {
|
|
@@ -258,7 +258,8 @@ module.exports = async ({
|
|
|
258
258
|
DEBUG: false
|
|
259
259
|
},
|
|
260
260
|
},
|
|
261
|
-
encryptionPath = 0
|
|
261
|
+
encryptionPath = 0,
|
|
262
|
+
afterBuild = () => { }
|
|
262
263
|
} = {}) => {
|
|
263
264
|
console.log(`\x1B[33m
|
|
264
265
|
┌─────────────────────┐
|
|
@@ -274,6 +275,7 @@ module.exports = async ({
|
|
|
274
275
|
await execSync(`rm -rf ${dst}`)
|
|
275
276
|
await build({ src, dst, ignoreDir, ignoreFile, copyright, noBuildFile, noBuildDir, noEncryptionPathFile, options, encryptionPath })
|
|
276
277
|
process.nextTick(async () => {
|
|
278
|
+
afterBuild && afterBuild()
|
|
277
279
|
console.log("")
|
|
278
280
|
console.log(`number of files: \x1B[36m${count[0]}\x1B[0m`)
|
|
279
281
|
console.log(`Number of Obfuscated Files: \x1B[36m${count[1]}\x1B[0m`)
|