{"id":14350121,"url":"https://github.com/z0ffy/vite-plugin-bundle-obfuscator","last_synced_at":"2026-01-14T14:32:35.879Z","repository":{"id":249765641,"uuid":"832450469","full_name":"z0ffy/vite-plugin-bundle-obfuscator","owner":"z0ffy","description":"JavaScript obfuscator plugin provides customizable options and multi-threaded support for Vite.","archived":false,"fork":false,"pushed_at":"2025-12-18T14:39:24.000Z","size":639,"stargazers_count":268,"open_issues_count":7,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-12-21T02:49:17.987Z","etag":null,"topics":["javascript-obfuscator","nuxt3","obfuscated-code","vite","vite-javascript-obfuscator","vite-lit","vite-plugin","vite-react","vite-rolldown","vite-solidjs","vite-svelte","vite-vue"],"latest_commit_sha":null,"homepage":"https://zoffy.me/post/【Plugin】Vite%20Javascript%20obfuscator","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/z0ffy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-07-23T03:55:58.000Z","updated_at":"2025-12-19T06:12:34.000Z","dependencies_parsed_at":"2024-10-27T17:57:38.373Z","dependency_job_id":"0fa54c93-f32b-4939-87a5-1603eb901ecd","html_url":"https://github.com/z0ffy/vite-plugin-bundle-obfuscator","commit_stats":null,"previous_names":["z0ffy/vite-bundle-obfuscator"],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/z0ffy/vite-plugin-bundle-obfuscator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z0ffy%2Fvite-plugin-bundle-obfuscator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z0ffy%2Fvite-plugin-bundle-obfuscator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z0ffy%2Fvite-plugin-bundle-obfuscator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z0ffy%2Fvite-plugin-bundle-obfuscator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/z0ffy","download_url":"https://codeload.github.com/z0ffy/vite-plugin-bundle-obfuscator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z0ffy%2Fvite-plugin-bundle-obfuscator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28423384,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T13:30:50.153Z","status":"ssl_error","status_checked_at":"2026-01-14T13:29:08.907Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript-obfuscator","nuxt3","obfuscated-code","vite","vite-javascript-obfuscator","vite-lit","vite-plugin","vite-react","vite-rolldown","vite-solidjs","vite-svelte","vite-vue"],"created_at":"2024-08-27T04:00:38.141Z","updated_at":"2026-01-14T14:32:35.870Z","avatar_url":"https://github.com/z0ffy.png","language":"TypeScript","funding_links":[],"categories":["Recently Updated","Plugins"],"sub_categories":["[Aug 26, 2024](/content/2024/08/26/README.md)","Framework-agnostic Plugins"],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg height=\"160\" src=\"https://obfuscator.io/logo.png\" alt=\"vite-plugin-bundle-obfuscator logo\" /\u003e\n\n# vite-plugin-bundle-obfuscator\n\nJavaScript `obfuscator` plugin for `Vite` environments\n\n[![awesome-vite](https://awesome.re/badge.svg)](https://github.com/vitejs/awesome-vite)\n[![npm version](https://img.shields.io/npm/v/vite-plugin-bundle-obfuscator?style=flat\u0026colorA=18181B\u0026colorB=28CF8D\u0026logo=npm)](https://www.npmjs.com/package/vite-plugin-bundle-obfuscator)\n[![npm downloads](https://img.shields.io/npm/dt/vite-plugin-bundle-obfuscator?style=flat\u0026colorA=18181B\u0026colorB=28CF8D\u0026logo=npm)](https://www.npmjs.com/package/vite-plugin-bundle-obfuscator)\n[![GitHub Release Date](https://img.shields.io/github/release-date/z0ffy/vite-plugin-bundle-obfuscator?style=flat\u0026colorA=18181B\u0026colorB=a855f7)](https://github.com/z0ffy/vite-plugin-bundle-obfuscator/releases)\n[![codecov](https://codecov.io/gh/z0ffy/vite-plugin-bundle-obfuscator/graph/badge.svg)](https://codecov.io/gh/z0ffy/vite-plugin-bundle-obfuscator)\n[![GitHub License](https://img.shields.io/github/license/z0ffy/vite-plugin-bundle-obfuscator?style=flat\u0026colorA=18181B\u0026colorB=white)](https://github.com/z0ffy/vite-plugin-bundle-obfuscator/blob/main/LICENSE)\n\n[📝 Changelog](./CHANGELOG.md) · [🐛 Report Bug][github-issues-link] · [✨ Request Feature][github-pr-link]\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eEnglish\u003c/strong\u003e | \u003ca href=\"./README.zh-CN.md\"\u003e中文\u003c/a\u003e\n\u003c/p\u003e\n\n![](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)\n\n\u003c/div\u003e\n\n\u003c!-- Badge Links --\u003e\n[npm-release-shield]: https://img.shields.io/npm/v/vite-plugin-bundle-obfuscator?style=flat\u0026colorA=18181B\u0026colorB=28CF8D\u0026logo=npm\n[npm-downloads-shield]: https://img.shields.io/npm/dt/vite-plugin-bundle-obfuscator?style=flat\u0026colorA=18181B\u0026colorB=28CF8D\u0026logo=npm\n[npm-release-link]: https://www.npmjs.com/package/vite-plugin-bundle-obfuscator\n[github-releasedate-shield]: https://img.shields.io/github/release-date/z0ffy/vite-plugin-bundle-obfuscator?style=flat\u0026colorA=18181B\u0026colorB=a855f7\n[github-releasedate-link]: https://github.com/z0ffy/vite-plugin-bundle-obfuscator/releases\n[github-license-shield]: https://img.shields.io/github/license/z0ffy/vite-plugin-bundle-obfuscator?style=flat\u0026colorA=18181B\u0026colorB=white\n[github-license-link]: https://github.com/z0ffy/vite-plugin-bundle-obfuscator/blob/main/LICENSE\n[github-issues-link]: https://github.com/z0ffy/vite-plugin-bundle-obfuscator/issues\n[github-pr-link]: https://github.com/z0ffy/vite-plugin-bundle-obfuscator/pulls\n\n## ⭐️ Features\n\n- ✅ ⚡ Supports `JavaScript obfuscation` in `Vite` projects.\n- ✅ 🚀 Multi-threading support for better performance.\n- ✅ ⚙️ Customizable obfuscator options to fit your needs.\n- ✅ 🛡️ Auto-excludes `node_modules`.\n- ✅ 📦 Support the `node_modules` split chunk.\n\n## ⚠️ Notice\n\n- If a memory overflow occurs, modify the packaging command to\n  `\"build\": \"cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build\"`, where `max-old-space-size` is set according\n  to the configuration.\n- When setting up `node_modules` split chunk, please place the accurate package name at the front. For\n  example: [\"vue-router\", \"vue\"], \"vue\" can match both \"vue\" and \"vue-router\" at the same time.\n\n## 🌐 Online\n\n✦ [Vite - Vanilla](https://stackblitz.com/edit/vitejs-vite-zsytij?file=vite.config.js)\n✦ [Vite - Vue](https://stackblitz.com/edit/vitejs-vite-ywho91?file=vite.config.js)\n✦ [Vite - React](https://stackblitz.com/edit/vitejs-vite-wyeur4?file=vite.config.js)\n✦ [Vite - PReact](https://stackblitz.com/edit/vitejs-vite-oujmks?file=vite.config.js)\n✦ [Vite - lit](https://stackblitz.com/edit/vitejs-vite-ru4gws?file=vite.config.js)\n✦ [Vite - Svelte](https://stackblitz.com/edit/vitejs-vite-fthdtu?file=vite.config.js)\n✦ [Vite - Solid](https://stackblitz.com/edit/vitejs-vite-dcx3eh?file=vite.config.js)\n✦ [Vite - Qwik](https://stackblitz.com/edit/vitejs-vite-i2bjvq?file=vite.config.js)\n✦ ...\n\n## 📦 Installation\n\n```bash\n# Using npm\nnpm install vite-plugin-bundle-obfuscator -D\n\n# Using pnpm\npnpm add vite-plugin-bundle-obfuscator -D\n\n# Using yarn\nyarn add vite-plugin-bundle-obfuscator -D\n```\n\n## 👨‍💻 Usage\n\n1. Install the plugin using your preferred package manager.\n2. Register the plugin in `vite.config.js`\n3. Customize the obfuscator configuration or use the default options.\n\nExample:\n\n```javascript\nimport vitePluginBundleObfuscator from 'vite-plugin-bundle-obfuscator';\n\n// All configurations\nconst allObfuscatorConfig = {\n  excludes: [],\n  enable: true,\n  log: true,\n  autoExcludeNodeModules: true,\n  // autoExcludeNodeModules: { enable: true, manualChunks: ['vue'] }\n  threadPool: true,\n  // threadPool: { enable: true, size: 4 }\n  options: {\n    compact: true,\n    controlFlowFlattening: true,\n    controlFlowFlatteningThreshold: 1,\n    deadCodeInjection: false,\n    debugProtection: false,\n    debugProtectionInterval: 0,\n    disableConsoleOutput: false,\n    identifierNamesGenerator: 'hexadecimal',\n    log: false,\n    numbersToExpressions: false,\n    renameGlobals: false,\n    selfDefending: true,\n    simplify: true,\n    splitStrings: false,\n    ignoreImports: true,\n    stringArray: true,\n    stringArrayCallsTransform: true,\n    stringArrayCallsTransformThreshold: 0.5,\n    stringArrayEncoding: [],\n    stringArrayIndexShift: true,\n    stringArrayRotate: true,\n    stringArrayShuffle: true,\n    stringArrayWrappersCount: 1,\n    stringArrayWrappersChainedCalls: true,\n    stringArrayWrappersParametersMaxCount: 2,\n    stringArrayWrappersType: 'variable',\n    stringArrayThreshold: 0.75,\n    unicodeEscapeSequence: false,\n  }\n};\n\nexport default {\n  plugins: [\n    vitePluginBundleObfuscator(allObfuscatorConfig)\n  ]\n};\n\n// Simplified configurations\nconst minimizeObfuscatorConfig = {\n  autoExcludeNodeModules: true,\n  // autoExcludeNodeModules: { enable: true, manualChunks: ['vue'] }\n  threadPool: true,\n  // threadPool: { enable: true, size: 4 }\n};\n\nexport default {\n  plugins: [\n    vitePluginBundleObfuscator(minimizeObfuscatorConfig)\n  ]\n};\n\n// Default configurations\nexport default {\n  plugins: [\n    vitePluginBundleObfuscator()\n  ]\n};\n```\n\n## 🧵 Web Worker Support\n\nBy default, worker bundles generated from `?worker` / `new Worker(new URL(...))` are **not** obfuscated.\n\nEnable worker obfuscation:\n\n```js\nimport vitePluginBundleObfuscator from 'vite-plugin-bundle-obfuscator';\n\nexport default {\n  plugins: [\n    vitePluginBundleObfuscator({\n      obfuscateWorker: true,\n    }),\n  ],\n};\n```\n\nExclude extra files only for workers:\n\n```js\nvitePluginBundleObfuscator({\n  obfuscateWorkerExcludes: [/comlink\\\\.worker.*\\\\.js$/],\n});\n```\n\n## 🚀 Performance Comparison\n\nWith **7000+ modules** and **400+ bundles** on a **4C 8G** machine:\n\n- **ThreadPool Enabled**   : 🟩🟩🟩⬜⬜⬜⬜⬜⬜ (About 30 seconds)\n- **ThreadPool Disabled**  : 🟥🟥🟥🟥🟥🟥🟥🟥🟥 (About 90 seconds)\n\n## 🛠️ Options\n\n| Property Name          | Description                                                             | Type                                                                                | Default                 | Version                                                         |\n|------------------------|-------------------------------------------------------------------------|-------------------------------------------------------------------------------------|-------------------------|-----------------------------------------------------------------|\n| threadPool             | Configuration for the thread pool.                                      | boolean \\| ({ enable: true; size: number } \\| { enable: false })                    | false                   | v1.2.0                                                          |\n| apply                  | Apply the plugin only for serve or build, or on certain conditions.     | 'serve' \\| 'build' \\| ((this: void, config: UserConfig, env: ConfigEnv) =\u003e boolean) | build                   | v1.1.0                                                          |\n| autoExcludeNodeModules | Enable auto exclude node_modules.                                       | boolean \\| ({ enable: true; manualChunks: string[] } \\| { enable: false })          | false                   | v1.0.9 (originally boolean, extended to current type in v1.3.0) |\n| obfuscateWorker        | Enable or disable obfuscation for Web Worker bundles.                   | boolean \\| { enable: boolean }                                                     | false                   | v1.10.0                                                         |\n| obfuscateWorkerExcludes | Additional excludes only for workers (final: `excludes + obfuscateWorkerExcludes`). | (RegExp \\| string)[]                                                               | []                      | v1.10.0                                                         |\n| log                    | Show or hide log output.                                                | boolean                                                                             | true                    | v1.0.4                                                          |\n| enable                 | Enable or disable the obfuscator.                                       | boolean                                                                             | true                    | v1.0.1                                                          |\n| excludes               | Bundle names to be excluded. Starting from v1.0.8, RegExp is supported. | (RegExp \\| string)[]                                                                | []                      | v1.0.0                                                          |\n| options                | Options for the JavaScript obfuscator.                                  | ObfuscatorOptions                                                                   | defaultObfuscatorConfig | v1.0.0                                                          |\n\n## 📄 License\n\n[MIT](https://opensource.org/licenses/MIT) License Copyright (c) 2024-present, Zoffy\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fz0ffy%2Fvite-plugin-bundle-obfuscator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fz0ffy%2Fvite-plugin-bundle-obfuscator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fz0ffy%2Fvite-plugin-bundle-obfuscator/lists"}