Files
server/obfuscate.config.js

37 lines
1.1 KiB
JavaScript
Raw Permalink Normal View History

2026-02-09 16:34:01 +08:00
/**
* JavaScript 混淆配置
* 用于增加代码阅读难度防止代码被轻易破解
*/
module.exports = {
compact: true,
controlFlowFlattening: true,
controlFlowFlatteningThreshold: 0.75,
deadCodeInjection: true,
deadCodeInjectionThreshold: 0.4,
debugProtection: false, // 设置为 true 会阻止调试,但可能影响性能
debugProtectionInterval: 0,
disableConsoleOutput: false, // 设置为 true 会移除 console但可能影响调试
identifierNamesGenerator: 'hexadecimal',
log: false,
numbersToExpressions: true,
renameGlobals: false,
selfDefending: false, // 设置为 false避免与 pkg 冲突
simplify: true,
splitStrings: true,
splitStringsChunkLength: 10,
stringArray: true,
stringArrayCallsTransform: true,
stringArrayEncoding: ['base64'],
stringArrayIndexShift: true,
stringArrayRotate: true,
stringArrayShuffle: true,
stringArrayWrappersCount: 2,
stringArrayWrappersChainedCalls: true,
stringArrayWrappersParametersMaxCount: 4,
stringArrayWrappersType: 'function',
stringArrayThreshold: 0.75,
transformObjectKeys: true,
unicodeEscapeSequence: false
}