37 lines
1.1 KiB
JavaScript
37 lines
1.1 KiB
JavaScript
|
|
/**
|
|||
|
|
* 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
|
|||
|
|
}
|
|||
|
|
|