A Rollup plugin for obfuscating JavaScript code using ByteHide Shield.
npm install @bytehide/rollup-shield --save-dev
// rollup.config.js
import ByteHideShieldPlugin from '@bytehide/rollup-shield';
export default {
input: 'src/index.js',
output: {
dir: 'dist',
format: 'es'
},
plugins: [
ByteHideShieldPlugin({
projectToken: 'your-bytehide-token',
// Optional configurations
distDir: 'dist',
replace: false,
obfuscatedExtension: '.obf',
exclude: ['excluded.js'],
config: {
controlFlowFlattening: true,
debugProtection: false,
devtoolsBlocking: false,
}
})
]
};
-
projectToken
(required): Your ByteHide project token -
distDir
(optional): Output directory (default: 'dist') -
replace
(optional): Replace original files (default: false) -
obfuscatedExtension
(optional): Extension for obfuscated files (default: '.obf') -
exclude
(optional): Array of files to exclude from obfuscation -
config
(optional): ByteHide Shield configuration options
MIT
Happy coding but keep it safe with @bytehide/rollup-shield
! 🛡️