Docs
/
Basic Obfuscation
/

Conditional Comments

Conditional Comments

Pro Tip

You can selectively disable obfuscation for specific parts of your code using special comments.

// 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() { ... }

Useful when you need to keep specific configuration blocks, version strings, or inline documentation readable in the output — without giving up obfuscation for the rest of the file.