{"id":22596,"library":"vite-plugin-bundle-obfuscator","title":"vite-plugin-bundle-obfuscator","description":"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.","status":"active","version":"1.11.0","language":"javascript","source_language":"en","source_url":"https://github.com/z0ffy/vite-plugin-bundle-obfuscator","tags":["javascript","vite","vite-rolldown","nuxt","obfuscator","vite-plugin-obfuscator","vite-bundle-obfuscator","vite-javascript-obfuscator","typescript"],"install":[{"cmd":"npm install vite-plugin-bundle-obfuscator","lang":"bash","label":"npm"},{"cmd":"yarn add vite-plugin-bundle-obfuscator","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-plugin-bundle-obfuscator","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency - plugin runs only in Vite projects","package":"vite","optional":false},{"reason":"runtime dependency for core obfuscation logic","package":"javascript-obfuscator","optional":false}],"imports":[{"note":"ESM-only since v1.0. No CommonJS export.","wrong":"const vitePluginBundleObfuscator = require('vite-plugin-bundle-obfuscator')","symbol":"default","correct":"import vitePluginBundleObfuscator from 'vite-plugin-bundle-obfuscator'"},{"note":"TypeScript type exports are available.","wrong":"","symbol":"types","correct":"import type { Options } from 'vite-plugin-bundle-obfuscator'"},{"note":"The package exports a default function only; named import does not exist.","wrong":"import { vitePluginBundleObfuscator } from 'vite-plugin-bundle-obfuscator'","symbol":"createPlugin","correct":"import vitePluginBundleObfuscator from 'vite-plugin-bundle-obfuscator'"}],"quickstart":{"code":"import { defineConfig } from 'vite';\nimport vitePluginBundleObfuscator from 'vite-plugin-bundle-obfuscator';\n\nexport default defineConfig({\n  plugins: [\n    vitePluginBundleObfuscator({\n      enable: true,\n      log: true,\n      autoExcludeNodeModules: true,\n      excludes: [],\n      options: {\n        compact: true,\n        controlFlowFlattening: true,\n        controlFlowFlatteningThreshold: 0.75,\n        deadCodeInjection: false,\n        debugProtection: false,\n        disableConsoleOutput: true,\n        identifierNamesGenerator: 'hexadecimal',\n        numbersToExpressions: true,\n        simplify: true,\n        stringArray: true,\n        stringArrayEncoding: ['base64'],\n        stringArrayThreshold: 0.75,\n        transformObjectKeys: true,\n        unicodeEscapeSequence: false\n      }\n    })\n  ]\n});","lang":"typescript","description":"Basic setup of vite-plugin-bundle-obfuscator in vite.config.ts with common obfuscator options."},"warnings":[{"fix":"Upgrade Node.js to version 20 or later.","message":"Node.js 18 is no longer supported as of v1.11.0. Minimum required version is 20.","severity":"breaking","affected_versions":">=1.11.0"},{"fix":"Set NODE_OPTIONS=--max-old-space-size=8192 before the build command.","message":"If you experience out-of-memory errors during build, increase memory limit using NODE_OPTIONS with --max-old-space-size.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use more specific names like 'vue-router' before 'vue' in the chunk splitting array.","message":"When configuring node_modules chunk splitting, prefix the exact package name to avoid overlapping matches (e.g., 'vue' matches both 'vue' and 'vue-router').","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Replace 'rc4' with 'base64' in the obfuscator options.","message":"Option 'stringArrayEncoding' with value 'rc4' is deprecated and will be removed in future versions. Use 'base64' instead.","severity":"deprecated","affected_versions":"<1.5.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use import instead: import vitePluginBundleObfuscator from 'vite-plugin-bundle-obfuscator'","cause":"The package is ESM-only and cannot be required with require().","error":"Module \"vite-plugin-bundle-obfuscator\" has been resolved to ESM but a CommonJS module is required."},{"fix":"Use: import vitePluginBundleObfuscator from 'vite-plugin-bundle-obfuscator' (not in curly braces)","cause":"Using named import instead of default import.","error":"TypeError: vitePluginBundleObfuscator is not a function"},{"fix":"Update Vite to version 4.0.0 or newer: npm install vite@latest","cause":"Vite version is too old; minimum required is 4.0.0.","error":"Error: The plugin requires Vite 4.0.0 or newer, but found version 3.x."},{"fix":"Set NODE_OPTIONS=--max-old-space-size=8192 before build command.","cause":"Build process ran out of memory due to large codebase being obfuscated.","error":"FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}