Skip to content
PluginStats

context-map-webpack-plugin weekly downloads statistics

By bastidest · npm · Webpack plugins

Webpack plugin to map dynamic (thirdparty) dependencies to a static context map.

View on npm Fresh · Dec 6, 2026

context-map-webpack-plugin has 163 recorded weekly downloads on npm, an increase of 71.6% over the past 30 days, ranking #2536 of 3,247 tracked listings.

Weekly downloads
163
Official API · Dec 5, 2026
7-day growth
+40.5%
+47 weekly downloads
30-day growth
+71.6%
+68 weekly downloads
90-day growth
-9.9%
-18 weekly downloads
Rank
#2536
▼ 52 in 7 days

About context-map-webpack-plugin

context-map-webpack-plugin

Webpack plugin to map dynamic (thirdparty) dependencies to a static context map.

Install

npm install -D context-map-webpack-plugin

Why do I need it / What does it do?

The Problem

Some (thirdparty) code requires other files with expressions that cannot be resolved by webpack at compile-time. Webpack tries to generate a regular expression that determines which files to include in the webpack bundle. In more complex expressions, webpack is unable to determine which files to include, thus an empty context map will be created.

A dynamic import that cannot be resolved might look like this:

// ...
var FILES = UglifyJS.FILES = [
    "../lib/utils.js",
    "../lib/ast.js",
    "../lib/parse.js",
    "../lib/transform.js",
    "../lib/scope.js",
    "../lib/output.js",
    "../lib/compress.js",
    "../lib/sourcemap.js",
    "../lib/mozilla-ast.js",
    "../lib/propmangle.js",
    "./exports.js",
].map(function(file){
    return require.resolve(file);
});
// ...

Your webpack build will probably have this Critical dependency warning:

WARNING in ./node_modules/uglify-js/tools/node.js 24:11-32
Critical dependency: the request of a dependency is an expression
 @ ./node_modules/pug-filters/lib/run-filter.js
 @ ./node_modules/pug-filters/index.js
 @ ./node_modules/pug/lib/index.js
 @ ./src/server/PugHandler.ts
 @ ./src/server/Router.ts
 @ ./src/server/index.ts
 @ multi ./src/server/index.ts webpack/hot/poll?1000

This will result in a bundle output that looks like this:

// ...
***/ "./node_modules/uglify-js/tools sync recursive":
/*!*******************************************!*\
  !*** ./node_modules/uglify-js/tools sync ***!
  \*******************************************/
/*! no static exports found */
/***/ (function(module, exports) {

eval("function webpackEmptyContext(req) {\n\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\te.code = 'MODULE_NOT_FOUND';\n\tthrow e;\n}
// ...

This empty context will lead to runtime errors:

node ./dist/server/main.js
undefined:4
	throw e;
	^

Error: Cannot find module '../lib/utils.js'
    at Function.webpackEmptyContext [as resolve] (eval at ./node_modules/uglify-js/tools sync recursive (<project_dir>/dist/server/main.js:5371:1), <anonymous>:2:10)
// ...
The Solution

Create a static context map in compile-time in order to include all required dependencies. You are required to investigate all possible runtime values of the required argument where the error originates from. These values have to be passed as the staticImports argument in the plugin constructor.

Alternatives

If you use webpack for the backend, you can exclude the required files from the webpack bundle and depend on node_mdules by using webpack-node-externals.

Usage

In your webpack configuration:

const ContextMapPlugin = require('context-map-webpack-plugin');

module.exports = {
  // ...
  plugins: [
    new ContextMapPlugin(contextPath, staticImports)
  ],
  // ...
};

Parameters

contextPath
  • Type: String
  • Default: undefined

Specify the directory in which to create/overwrite the context map.

staticImports
  • Type: Array[String]
  • Default: undefined

Static imports that will be written to the context map (and bundled with webpack at compile-time).

Example (uglify-js)

  // ...
  plugins: [
    new ContextMapPlugin('node_modules/uglify-js/tools', [
      '../lib/utils.js',
      '../lib/ast.js',
      '../lib/parse.js',
      '../lib/transform.js',
      '../lib/scope.js',
      '../lib/output.js',
      '../lib/compress.js',
      '../lib/sourcemap.js',
      '../lib/mozilla-ast.js',
      '../lib/propmangle.js',
      './exports.js',
    ])
  ],
  // ...

License

MIT

Description from the npm listing.

  • webpack
  • plugin
  • webpack-plugin
  • context
  • import
  • require

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

context-map-webpack-plugin weekly downloads on npm, last 90 days: 163 weekly downloads as of Dec 5, 2026, -9.9% over 90 days.context-map-webpack-pluginWeekly downloads on npm · Last 90 days163downloads / week-9.9% over 90 days050100150200250300Sep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
context-map-webpack-plugin weekly downloads on npm, last 90 days: 163 weekly downloads as of Dec 5, 2026, -9.9% over 90 days.

7/30/90-day growth

context-map-webpack-plugin weekly downloads growth on npm: +40.5% over 7 days, +71.6% over 30 days, -9.9% over 90 days.context-map-webpack-pluginWeekly downloads growth on npm163downloads / week now7-day growth+47 weekly downloads+40.5%30-day growth+68 weekly downloads+71.6%90-day growth-18 weekly downloads-9.9%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
context-map-webpack-plugin weekly downloads growth on npm: +40.5% over 7 days, +71.6% over 30 days, -9.9% over 90 days.

Ranking history

context-map-webpack-plugin npm ranking history: currently #2536 (by weekly downloads).context-map-webpack-pluginnpm ranking · by weekly downloads · Last 90 days#2536current rank#1600#1800#2000#2200#2400#2600Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
context-map-webpack-plugin npm ranking history: currently #2536 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 127, #16 (overall #2,536)
All npm: every listing in weekly downloads order

Listing placement

Webpack plugins349 listings · 18 pages · page 8, #7 (overall #147)
Webpack plugins: every listing in weekly downloads order

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)
Recent weekly downloads observations for context-map-webpack-plugin
Date (UTC)Weekly downloadsChange vs. previous
1630
163+6
157-9
166+1
165+38
127+8
119+3
116-10
126+17
109+39
70+9
61+7
540
54—

Similar npm Webpack plugins plugins

All 20 context-map-webpack-plugin alternatives

Data 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/context-map-webpack-plugin. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.