{"id":13540315,"url":"https://github.com/javascript-obfuscator/webpack-obfuscator","last_synced_at":"2025-10-24T08:56:07.643Z","repository":{"id":8433194,"uuid":"58360964","full_name":"javascript-obfuscator/webpack-obfuscator","owner":"javascript-obfuscator","description":"javascript-obfuscator plugin for Webpack","archived":false,"fork":false,"pushed_at":"2023-07-12T21:30:19.000Z","size":835,"stargazers_count":902,"open_issues_count":58,"forks_count":86,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-01T03:55:14.570Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/javascript-obfuscator/javascript-obfuscator","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/javascript-obfuscator.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.BSD","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-05-09T08:30:14.000Z","updated_at":"2025-04-23T03:18:28.000Z","dependencies_parsed_at":"2024-01-23T21:45:26.962Z","dependency_job_id":null,"html_url":"https://github.com/javascript-obfuscator/webpack-obfuscator","commit_stats":{"total_commits":249,"total_committers":15,"mean_commits":16.6,"dds":0.5180722891566265,"last_synced_commit":"f214a34373f9631c5c2c3a56560f2ffbba976417"},"previous_names":[],"tags_count":148,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javascript-obfuscator%2Fwebpack-obfuscator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javascript-obfuscator%2Fwebpack-obfuscator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javascript-obfuscator%2Fwebpack-obfuscator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javascript-obfuscator%2Fwebpack-obfuscator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/javascript-obfuscator","download_url":"https://codeload.github.com/javascript-obfuscator/webpack-obfuscator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254259370,"owners_count":22040819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-08-01T09:01:46.315Z","updated_at":"2025-10-24T08:56:02.609Z","avatar_url":"https://github.com/javascript-obfuscator.png","language":"TypeScript","readme":"# javascript-obfuscator plugin and loader for Webpack@5\n\n[![npm version](https://badge.fury.io/js/webpack-obfuscator.svg)](https://badge.fury.io/js/webpack-obfuscator)\n\n### Installation\n\nThis plugin requires Webpack@5. If you depend on Webpack@4, please use [version 2](https://github.com/javascript-obfuscator/webpack-obfuscator/tree/2.6.0) of the plugin.\n\nInstall the plugin with NPM and add it to your devDependencies:\n\n`npm install --save-dev javascript-obfuscator webpack-obfuscator`\n\n### Plugin usage:\n\n```javascript\nvar WebpackObfuscator = require('webpack-obfuscator');\n\n// ...\n\n// webpack plugins array\nplugins: [\n    new WebpackObfuscator ({\n        rotateStringArray: true\n    }, ['excluded_bundle_name.js'])\n]\n```\n\n### Loader usage:\n\nDefine a rule in your webpack config and use the obfuscator-loader as the last of your loaders for your modules. You can add the **enforce: 'post'** flag to ensure the loader will be called after normal loaders:\n\n```javascript\nvar WebpackObfuscator = require('webpack-obfuscator');\n\n// webpack loader rules array\nrules: [\n    {\n        test: /\\.js$/,\n        exclude: [ \n            path.resolve(__dirname, 'excluded_file_name.js') \n        ],\n        enforce: 'post',\n        use: { \n            loader: WebpackObfuscator.loader, \n            options: {\n                rotateStringArray: true\n            }\n        }\n    }\n]\n```\n\n### obfuscatorOptions\nType: `Object` Default: `null`\n\nOptions for [javascript-obfuscator](https://github.com/javascript-obfuscator/javascript-obfuscator). Should be passed exactly like described on their page.\n\n### excludes (plugin only)\nType: `Array` or `String` Default: `[]`\n\nBundle name is output file name after webpack compilation. With multiple webpack entries you can set bundle name in `output` object with aliases `[name]` or `[id]`.\n\nSyntax for excludes array is syntax for [multimatch](https://github.com/sindresorhus/multimatch) package. You can see examples on package page.\n\nFew syntax examples: `['excluded_bundle_name.js', '**_bundle_name.js'] or 'excluded_bundle_name.js'`\n\n\nExample:\n```\n// webpack.config.js\n'use strict';\n\nconst JavaScriptObfuscator = require('webpack-obfuscator');\n\nmodule.exports = {\n    entry: {\n        'abc': './test/input/index.js',\n        'cde': './test/input/index1.js'\n    },\n    output: {\n        path: 'dist',\n        filename: '[name].js' // output: abc.js, cde.js\n    },\n    plugins: [\n        new JavaScriptObfuscator({\n            rotateStringArray: true\n        }, ['abc.js'])\n    ]\n};\n```\n\nCan be used to bypass obfuscation of some files.\n\n### License\nCopyright (C) 2022 [Timofey Kachalov](http://github.com/sanex3339).\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n  * Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n  * Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in the\n    documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED. IN NO EVENT SHALL \u003cCOPYRIGHT HOLDER\u003e BE LIABLE FOR ANY\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\nTHIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n","funding_links":[],"categories":["\u003ca id=\"783f861b9f822127dba99acb55687cbb\"\u003e\u003c/a\u003e工具"],"sub_categories":["\u003ca id=\"85bb0c28850ffa2b4fd44f70816db306\"\u003e\u003c/a\u003e混淆器\u0026\u0026Obfuscate"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavascript-obfuscator%2Fwebpack-obfuscator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjavascript-obfuscator%2Fwebpack-obfuscator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavascript-obfuscator%2Fwebpack-obfuscator/lists"}