A plugin to obfuscate javascript for rollup & vite based on javascript-obfuscator
npm install -D rollup-obfuscator
import { obfuscator } from 'rollup-obfuscator';
...
plugins: [
...
obfuscator()
...
]
...
All config options can be found here and are passed into the obfuscator plugin like this:
obfuscator({
// options
})
You can also pass in the following additional options:
-
global
- It's recommended to keep this enabled, since it might cause issues. However if you need access toinclude
andexclude
options you can disable this -
include
- A FilterPattern of files to include. By default only allows js/ts files - only works with global set to false -
exclude
- A FilterPattern of files to exclude. By default ignores node_modules - only works with global set to false