条件注释
Pro Tip
您可以使用特殊注释,对代码中的特定部分选择性地禁用混淆。
// This code WILL be obfuscated
var secret = 'protected';
// javascript-obfuscator:disable
var config = {
apiUrl: 'https://api.example.com', // Stays readable
version: '1.0.0'
};
// javascript-obfuscator:enable
// Obfuscation resumes here
function sensitiveLogic() { ... }
当您需要让特定的配置块、版本字符串或内联文档在输出中保持可读,同时又不放弃对文件其余部分的混淆时,这一功能十分有用。
