webpack-plugin-codefend weekly downloads statistics
By Codefend · npm · Webpack plugins
Webpack plugin for code obfuscation based on Codefend
webpack-plugin-codefend has 139 recorded weekly downloads on npm, an increase of 415% over the past 30 days, ranking #2560 of 3,247 tracked listings.
About webpack-plugin-codefend
webpack-plugin-codefend
Webpack plugin for code obfuscation based on Codefend.
Supports Webpack 5.
Installation
Install the plugin in your existing Webpack project:
npm install -D webpack-plugin-codefend
Usage
Recommended setup
Add the plugin to your webpack.config.mjs. Keep any other plugins and build settings your project needs.
import { fileURLToPath } from "node:url";
import { WebpackPluginCodefend } from "webpack-plugin-codefend";
export default {
mode: "production",
entry: "./src/main.js",
output: {
filename: "bundle.js",
path: fileURLToPath(new URL("./dist", import.meta.url)),
},
plugins: [new WebpackPluginCodefend({ parser: { name: "startWithMAndUnderscore" } })],
};
Custom options
Configure parser selection, obfuscation, and statistics with the parser, transformation, and debug options:
import { fileURLToPath } from "node:url";
import { WebpackPluginCodefend } from "webpack-plugin-codefend";
export default {
mode: "production",
entry: "./src/main.js",
output: {
filename: "bundle.js",
path: fileURLToPath(new URL("./dist", import.meta.url)),
},
plugins: [
new WebpackPluginCodefend({
parser: { name: "startWithMAndUnderscore" },
transformation: {
// Prefix for generated names.
prefix: "Ox",
// Explicit replacements for selected words.
static: [{ from: "predefined_secret", to: "123456" }],
// Words that should retain their original spelling.
ignore: ["node_modules"],
// Optional names to use before generating prefixed names.
pool: ["QueenOfHeart"],
},
debug: {
// Display statistics for transformed words.
stats: true,
},
}),
],
};
transformation.ignore contains words to preserve, not file paths or module filters. Statistics are enabled by default; use debug: { stats: false } to disable them.
Parser selection
parser.name accepts these two presets:
| Name | Selection |
|---|---|
startWithMAndUnderscore | Recommended for new projects: explicitly marked m_ names. |
codeOnly | The existing broader underscore naming rule; retained as the default. |
We recommend startWithMAndUnderscore because narrower selection helps leave unrelated names such as external_value and LED_BUILTIN unchanged. Use lowercase m_, followed by an ASCII letter and then letters or digits. For example, m_Total and m_value2 are selected; m_2total and m_total_amount are excluded.
Omitting parser, using parser: {}, or selecting codeOnly preserves the existing selection behavior. Custom regex lists and other core presets are not accepted by this plugin. Explicit static mappings still apply to their configured literal keys.
CLI settings for source copying and file/folder renaming are separate. See parser presets and the configuration reference.
Naming convention
Use the recommended m_ convention for application-owned names whose callers you control:
function m_add(m_left, m_right) {
return m_left + m_right;
}
console.log(m_add(2, 3));
Both supported parsers select these m_ names:
function Ox0(Ox1, Ox2) {
return Ox1 + Ox2;
}
console.log(Ox0(2, 3));
Both versions print 5. Generated names can vary with the input and build order. See the code naming conventions for other supported prefixes.
Codefend matches source text, so replacements can also affect strings and property names. Keep public exports, framework APIs, and external data contracts stable with transformation.ignore, and test the built application. Test custom pools across all modules before adopting them.
Migrate an existing project with AI
Use the AI migration prompt to adapt an existing project's internal variables, functions, classes, parameters, and members to Codefend's naming conventions. The guide provides a copyable prompt that asks your coding assistant to update references, preserve external interfaces and data keys, and test both the renamed source and the Codefend output.
Build behavior
The plugin transforms emitted assets during Webpack's asset-processing stage and prints statistics when compilation finishes. It runs whenever included in the configuration; the examples above configure a production build.
For development builds, include the plugin conditionally in your existing configuration if you want to leave development output unchanged. Verify emitted CSS, binary assets, multiple chunks, and interactions with other asset plugins in your application.
Build with your usual project command, or run:
npx webpack --config webpack.config.mjs
Examples…
Description from the npm listing.
- webpack
- codefend
- webpack-plugin
- plugin
- obfuscate
- obfuscation
- obfuscator
- uglification
- uglify
- uglifier
- vue
- react
- angular
- svelte
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (170)Similar npm Webpack plugins plugins
All 20 webpack-plugin-codefend alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/webpack-plugin-codefend. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.