{"id":22245324,"url":"https://github.com/codefend/webpack-plugin-codefend","last_synced_at":"2025-08-31T21:35:27.328Z","repository":{"id":65271711,"uuid":"589159362","full_name":"Codefend/webpack-plugin-codefend","owner":"Codefend","description":"Webpack plugin for code obfuscation using Codefend, providing protection for your code regardless of the programming language or framework.","archived":false,"fork":false,"pushed_at":"2025-01-01T21:24:37.000Z","size":1717,"stargazers_count":4,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-04T05:18:26.780Z","etag":null,"topics":["codefend","obfuscator","uglify","webpack","webpack-plugin"],"latest_commit_sha":null,"homepage":"https://codefend.github.io/docs","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/Codefend.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2023-01-15T09:09:55.000Z","updated_at":"2024-10-06T16:30:34.000Z","dependencies_parsed_at":"2024-04-28T19:22:38.839Z","dependency_job_id":"03596645-1119-4871-b746-988e1c3bf89e","html_url":"https://github.com/Codefend/webpack-plugin-codefend","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/Codefend/webpack-plugin-codefend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codefend%2Fwebpack-plugin-codefend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codefend%2Fwebpack-plugin-codefend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codefend%2Fwebpack-plugin-codefend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codefend%2Fwebpack-plugin-codefend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Codefend","download_url":"https://codeload.github.com/Codefend/webpack-plugin-codefend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codefend%2Fwebpack-plugin-codefend/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267453979,"owners_count":24089854,"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","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["codefend","obfuscator","uglify","webpack","webpack-plugin"],"created_at":"2024-12-03T05:13:19.834Z","updated_at":"2025-07-28T02:32:49.782Z","avatar_url":"https://github.com/Codefend.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n \u003cimg src=\"./public/img/logo.png\"\u003e\n\u003c/p\u003e\n\n# webpack-plugin-codefend\n\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/Codefend/webpack-plugin-codefend/ci.yaml?branch=main)\n![NPM](https://img.shields.io/npm/dt/webpack-plugin-codefend)\n![Bundlephobia](https://img.shields.io/bundlephobia/min/webpack-plugin-codefend)\n![Node version](https://img.shields.io/node/v/webpack-plugin-codefend)\n![NPM](https://img.shields.io/npm/l/webpack-plugin-codefend)\n\nWebpack plugin for code obfuscation based on [Codefend](https://www.npmjs.com/package/codefend)\n\n## Installation\n\n```bash\nnpm install -D webpack-plugin-codefend\n```\n\n## Usage\n\n### `Step 1`: Configuration\n\nAdd to your `webpack.config.js`:\n\n#### Default options\n\n```js\nimport { WebpackPluginCodefend } from \"webpack-plugin-codefend\";\n\nexport default {\n  entry: ...\n  output: ...,\n  plugins: [new WebpackPluginCodefend()],\n};\n```\n\n#### Custom options\n\n```js\nimport { WebpackPluginCodefend } from \"webpack-plugin-codefend\";\n\nexport default {\n  entry: ...\n  output: ...,\n  plugins: [\n    new WebpackPluginCodefend({\n      transformation:{\n            // the prefix to use for each obfuscated variable\n            prefix: \"Ox\",\n\n            // control how a specific variable should be obfuscated\n            static: [\n              {\n                from: \"predefined_secret\",\n                to: \"123456\",\n              },\n            ],\n\n            //will skip obfuscation for the following words\n            ignore: [\"node_modules\"],\n\n            /* By using everyday words such as books or lorem ipsum in the pool,\n            you can subtly obfuscate your code,\n            concealing its true nature without making it apparent that obfuscation is occurring.*/\n            pool: [\"QueenOfHeart\"],\n      },\n      debug: {\n            // to display detailed stats about the words that have been obfuscated\n            stats: true,\n      },\n    }),\n  ],\n};\n```\n\nFor a more detailed explanation, refer to the [configuration](https://codefend.github.io/docs/references/configuration) section of the `codefend` docs.\n\n### `Step 2`: Naming convention\n\nIn your code, `add prefixes to the words that you want Codefend to encrypt.`\n\n`Make sure to read the `[`Philosophy`](https://github.com/Codefend/core#philosophy)` behind Codefend obfuscation First to understand why Codefend can work with any code written in any language.`\n\n```js\n//node js example\n//as a starting point:  prefix the words that should be encrypted with l_\n\nclass l_Calculator {\n  l_sum(l_a, l_b) {\n    const l_results = l_a + l_b;\n    console.log(\"node_modules\");\n    console.log(\"predefined_secret\");\n    return l_results;\n  }\n}\n\n//\u003e\u003e\u003e\u003e\u003e\u003e==== Will Become ======\u003c\u003c\u003c\u003c\u003c\u003c\n\nclass QueenOfHeart /* 'QueenOfHeart' defined in pool*/ {\n  /* Ox1, Ox2... prefix transformation*/\n  Ox1(Ox2, Ox3) {\n    const Ox4 = Ox2 + Ox3;\n    console.log(\"node_modules\"); // has not been obfuscated\n    console.log(\"123456\"); // has transformed from \"predefined_secret\" to \"123456\"\n    return Ox4;\n  }\n}\n```\n\n```html\n\u003c!-- Html example, can work also with Angular,React,Vue,Svelte... in the same way --\u003e\n\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cstyle\u003e\n      .l_red {\n        color: red;\n      }\n    \u003c/style\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cdiv class=\"l_red\"\u003el_secret\u003c/div\u003e\n    \u003cdiv class=\"l_red\"\u003eHello World\u003c/div\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n\n\u003c!-- Will Become --\u003e\n\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cstyle\u003e\n      .Ox1 {\n        color: red;\n      }\n    \u003c/style\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cdiv class=\"Ox1\"\u003eOx0\u003c/div\u003e\n    \u003cdiv class=\"Ox1\"\u003eHello World\u003c/div\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n## Examples\n\n1. ### [`Node js`](./example)\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n\n## License\n\n[MIT](./LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodefend%2Fwebpack-plugin-codefend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodefend%2Fwebpack-plugin-codefend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodefend%2Fwebpack-plugin-codefend/lists"}