Registry / devops / rollup-plugin-post-obfuscator

rollup-plugin-post-obfuscator

JSON →
library1.0.0jsnpmunverified

Rollup plugin that obfuscates JavaScript output after the bundle is generated. Current stable version is 1.0.0. It leverages javascript-obfuscator under the hood and supports dynamic import obfuscation, inclusion/exclusion patterns, and source map handling. Unlike other obfuscation plugins that operate during the build process, this plugin post-processes the output, making it compatible with various output formats and easier to integrate. It ships TypeScript types and requires Node >=16 and Rollup <5.

npm install rollup-plugin-post-obfuscator
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-POST
R
rollup-plugin-post-obfuscator
devopsjavascriptv1.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default (obfuscator)
import obfuscator from 'rollup-plugin-post-obfuscator'
const obfuscator = require('rollup-plugin-post-obfuscator')
Plugin uses ESM only; CJS require may fail in older Node versions <16.
default in Rollup config
import obfuscator from 'rollup-plugin-post-obfuscator'; export default { plugins: [obfuscator()] }
import { obfuscator } from 'rollup-plugin-post-obfuscator'
The plugin is exported as default, not named.
TypeScript type
import type { ObfuscatorOptions } from 'rollup-plugin-post-obfuscator'
For TypeScript, use type import for options types.

Basic Rollup config using the obfuscator plugin with typical options including include/exclude patterns and custom javascript-obfuscator options.

// rollup.config.js import obfuscator from 'rollup-plugin-post-obfuscator'; export default { input: 'src/index.js', output: { dir: 'dist', format: 'es', }, plugins: [ obfuscator({ outDir: 'dist', include: ['**/*.js'], exclude: ['vendor/**'], JavaScriptObfuscatorOptions: { compact: true, controlFlowFlattening: true, }, }), ], };
Debug
Known issues
gotchaPlugin requires Rollup <5; using with Rollup 5 will cause a peer dependency warning and may break.
fix
Use Rollup 4 or earlier.
affects: >=1.0.0
gotchaThe 'outDir' option must match Rollup's output.dir exactly; otherwise, the plugin may fail to find generated files.
fix
Set obfuscator({ outDir: output.dir }) or ensure consistency.
affects: >=1.0.0
gotchaObfuscation of source maps is not well documented; if source maps are enabled, the plugin may not update them correctly.
fix
Test with source maps or disable them if obfuscation breaks them.
affects: >=1.0.0
gotchaDynamic import obfuscation may not work reliably with all output formats (e.g., SystemJS).
fix
Test with your specific format; consider using 'es' or 'cjs'.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'rollup-plugin-post-obfuscator'
Missing npm install or using wrong package name.
fix
Run 'npm install --save-dev rollup-plugin-post-obfuscator'
TypeError: obfuscator is not a function
Named import instead of default import.
fix
Use 'import obfuscator from ...' not '{ obfuscator }'.
ERR_PEER_DEP_INVALID: rollup@5.0.0 invalid for rollup-plugin-post-obfuscator@1.0.0
Plugin requires Rollup <5, but Rollup 5 is installed.
fix
Downgrade Rollup to 4.x.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
rolluprequiredPeer dependency; works with Rollup versions below 5.
javascript-obfuscatorrequiredUnderlying obfuscation engine used by the plugin.
Agent activity
4 hits · last 30 days
node
4
Resources
rollup-plugin-post-obfuscator — npm install rollup-plugin-post-obfuscator · libregistry