Grunt plugin for ByteHide Shield code obfuscation
npm install @bytehide/grunt-shieldA Grunt plugin for protecting JavaScript files using ByteHide Shield obfuscation.
``bash`
npm install @bytehide/grunt-shield --save-dev
Add this to your Gruntfile.js:
`javascript
module.exports = function (grunt) {
grunt.initConfig({
bytehideShield: {
options: {
projectToken: 'your-bytehide-token', // or use process.env.BYTEHIDE_TOKEN
distDir: 'dist', // Directory containing files to protect
replace: false, // Replace original files or create new ones
obfuscatedExtension: '.obf', // Extension for protected files
exclude: [], // Files to exclude from protection
config: {
controlFlowFlattening: true,
debugProtection: false,
devtoolsBlocking: false,
}
},
dist: {}
}
});
grunt.loadNpmTasks('@bytehide/grunt-shield');
};
`
Run the task:
`bash`
grunt bytehideShield
- projectToken: Your ByteHide project token (required)distDir
- : Directory containing files to protect (default: 'dist')replace
- : Whether to replace original files (default: false)obfuscatedExtension
- : Extension for protected files (default: '.obf')exclude
- : Array of filenames to exclude from protectionconfig
- : ByteHide Shield configuration optionscontrolFlowFlattening
- : Enable control flow flatteningdebugProtection
- : Enable debug protectiondevtoolsBlocking
- : Enable devtools blocking
MIT
---
Happy coding but keep it safe with @bytehide/grunt-shield`! 🛡️