Registry / devops / vite-plugin-bundle-obfuscator

vite-plugin-bundle-obfuscator

JSON →
library1.11.0jsnpmunverified

A JavaScript obfuscation plugin for Vite environments, version 1.11.0, with a release cadence of roughly monthly updates. Supports Vite 4/5/6/7/8 (including Rolldown), Nuxt.js, and library mode. Key differentiators: multi-threaded obfuscation, automatic node_modules exclusion, support for worker files, and a built-in code size analyzer. Ships TypeScript types. Requires Node >=20.

npm install vite-plugin-bundle-obfuscator
INSTALL
IMPORT
SIG · VITE-PLUGIN-BUNDLE
V
vite-plugin-bundle-obfuscator
devopsjavascriptv1.11.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
import vitePluginBundleObfuscator from 'vite-plugin-bundle-obfuscator'
const vitePluginBundleObfuscator = require('vite-plugin-bundle-obfuscator')
ESM-only since v1.0. No CommonJS export.
types
import type { Options } from 'vite-plugin-bundle-obfuscator'
TypeScript type exports are available.
createPlugin
import vitePluginBundleObfuscator from 'vite-plugin-bundle-obfuscator'
import { vitePluginBundleObfuscator } from 'vite-plugin-bundle-obfuscator'
The package exports a default function only; named import does not exist.

Basic setup of vite-plugin-bundle-obfuscator in vite.config.ts with common obfuscator options.

import { defineConfig } from 'vite'; import vitePluginBundleObfuscator from 'vite-plugin-bundle-obfuscator'; export default defineConfig({ plugins: [ vitePluginBundleObfuscator({ enable: true, log: true, autoExcludeNodeModules: true, excludes: [], options: { compact: true, controlFlowFlattening: true, controlFlowFlatteningThreshold: 0.75, deadCodeInjection: false, debugProtection: false, disableConsoleOutput: true, identifierNamesGenerator: 'hexadecimal', numbersToExpressions: true, simplify: true, stringArray: true, stringArrayEncoding: ['base64'], stringArrayThreshold: 0.75, transformObjectKeys: true, unicodeEscapeSequence: false } }) ] });
Debug
Known issues
breakingNode.js 18 is no longer supported as of v1.11.0. Minimum required version is 20.
fix
Upgrade Node.js to version 20 or later.
affects: >=1.11.0
gotchaIf you experience out-of-memory errors during build, increase memory limit using NODE_OPTIONS with --max-old-space-size.
fix
Set NODE_OPTIONS=--max-old-space-size=8192 before the build command.
affects: >=1.0.0
gotchaWhen configuring node_modules chunk splitting, prefix the exact package name to avoid overlapping matches (e.g., 'vue' matches both 'vue' and 'vue-router').
fix
Use more specific names like 'vue-router' before 'vue' in the chunk splitting array.
affects: >=1.0.0
deprecatedOption 'stringArrayEncoding' with value 'rc4' is deprecated and will be removed in future versions. Use 'base64' instead.
fix
Replace 'rc4' with 'base64' in the obfuscator options.
affects: <1.5.0
Errors
Common errors & fixes
Module "vite-plugin-bundle-obfuscator" has been resolved to ESM but a CommonJS module is required.
The package is ESM-only and cannot be required with require().
fix
Use import instead: import vitePluginBundleObfuscator from 'vite-plugin-bundle-obfuscator'
TypeError: vitePluginBundleObfuscator is not a function
Using named import instead of default import.
fix
Use: import vitePluginBundleObfuscator from 'vite-plugin-bundle-obfuscator' (not in curly braces)
Error: The plugin requires Vite 4.0.0 or newer, but found version 3.x.
Vite version is too old; minimum required is 4.0.0.
fix
Update Vite to version 4.0.0 or newer: npm install vite@latest
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
Build process ran out of memory due to large codebase being obfuscated.
fix
Set NODE_OPTIONS=--max-old-space-size=8192 before build command.
Upgrade
Version history
1.11.0latest on npm
Audit
Dependencies
viterequiredpeer dependency - plugin runs only in Vite projects
javascript-obfuscatorrequiredruntime dependency for core obfuscation logic
Agent activity
9 hits · last 30 days
node
8
Resources
vite-plugin-bundle-obfuscator — npm install vite-plugin-bundle-obfuscator · libregistry