A Rollup and Vite plugin for obfuscating JavaScript bundles using javascript-obfuscator. Current stable version is 4.1.1, released in September 2024. It supports Rollup v2, v3, and v4, and Vite build-time only. Key differentiators: it works as an end-of-pipeline plugin, filters files by pattern, and sets sensible defaults (sourceMap: true, stringArray: false) to reduce breakage. Requires Node 16+ and javascript-obfuscator v4 as a peer dependency. The plugin is actively maintained with regular releases addressing bugs and compatibility.
npm install rollup-obfuscatorVerified import paths — ran on the pinned version, not inferred.
Basic Rollup configuration with obfuscator plugin at the end of plugins array, demonstrating import and usage.
Remove options.global from your plugin call. The default behavior now matches v3's global: false.
Upgrade Node to v16 or later.
If you rely on the old defaults, explicitly set sourceMap: false and stringArray: true in options.
Always list obfuscator() as the last plugin.
Run 'npm install javascript-obfuscator --save-dev'.
Use import { obfuscator } from 'rollup-obfuscator' instead of import obfuscator from 'rollup-obfuscator'.npm install javascript-obfuscator --save-dev
Change to: import { obfuscator } from 'rollup-obfuscator';Move the obfuscator() call to the last position in the plugins array.