Skip to content
PluginStats

webpack-virtual-modules weekly downloads statistics

By sysgears (3 listings) · npm · Webpack plugins

Webpack Virtual Modules

View on npm Fresh · Dec 6, 2026

webpack-virtual-modules has 75,633,739 recorded weekly downloads on npm, an increase of 21.1% over the past 30 days, ranking #21 of 3,247 tracked listings.

Weekly downloads
75,633,739
Official API · Dec 5, 2026
7-day growth
+14.8%
+9.8M weekly downloads
30-day growth
+21.1%
+13.2M weekly downloads
90-day growth
+70.1%
+31.2M weekly downloads
Rank
#21
▲ 2 in 7 days

About webpack-virtual-modules

Webpack Virtual Modules

npm version npm downloads License

Webpack Virtual Modules is a plugin that allows for dynamical generation of in-memory virtual modules for JavaScript builds created with webpack. When virtual module is created all the parent virtual dirs that lead to the module filename are created too. This plugin supports watch mode meaning any write to a virtual module is seen by webpack as if a real file stored on disk has changed.

Installation

Use NPM or Yarn to install Webpack Virtual Modules as a development dependency:

# with NPM
npm install webpack-virtual-modules --save-dev

# with Yarn
yarn add webpack-virtual-modules --dev

Usage

You can use Webpack Virtual Modules with webpack 5, 4 and 3. The examples below show the usage with webpack 5 or 4. If you want to use our plugin with webpack 3, check out a dedicated doc:

Generating static virtual modules

Require the plugin in the webpack configuration file, then create and add virtual modules in the plugins array in the webpack configuration object:

var VirtualModulesPlugin = require('webpack-virtual-modules');

var virtualModules = new VirtualModulesPlugin({
  'node_modules/module-foo.js': 'module.exports = { foo: "foo" };',
  'node_modules/module-bar.js': 'module.exports = { bar: "bar" };'
});

module.exports = {
  // ...
  plugins: [
    virtualModules
  ]
};

You can now import your virtual modules anywhere in the application and use them:

var moduleFoo = require('module-foo');
// You can now use moduleFoo
console.log(moduleFoo.foo);
Generating dynamic virtual modules

You can generate virtual modules dynamically with Webpack Virtual Modules.

Here's an example of dynamic generation of a module. All you need to do is create new virtual modules using the plugin and add them to the plugins array. After that, you need to add a webpack hook. For using hooks, consult webpack compiler hook documentation.

var webpack = require('webpack');
var VirtualModulesPlugin = require('webpack-virtual-modules');

// Create an empty set of virtual modules
const virtualModules = new VirtualModulesPlugin();

var compiler = webpack({
  // ...
  plugins: [
    virtualModules
  ]
});

compiler.hooks.compilation.tap('MyPlugin', function(compilation) {
  virtualModules.writeModule('node_modules/module-foo.js', '');
});

compiler.watch();

In other module or a Webpack plugin, you can write to the module module-foo whatever you need. After this write, webpack will "see" that module-foo.js has changed and will restart compilation.

virtualModules.writeModule(
  'node_modules/module-foo.js',
  'module.exports = { foo: "foo" };'
);

More Examples

API Reference

Inspiration

This project is inspired by virtual-module-webpack-plugin.

License

Copyright © 2017 SysGears INC. This source code is licensed under the MIT license.

<!-- Badges -->

Description from the npm listing.

  • webpack
  • webpack-plugin
  • virtual
  • modules

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

webpack-virtual-modules weekly downloads on npm, last 90 days: 75,633,739 weekly downloads as of Dec 5, 2026, +70.1% over 90 days.webpack-virtual-modulesWeekly downloads on npm · Last 90 days75,633,739downloads / week+70.1% over 90 days020M40M60M80MSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
webpack-virtual-modules weekly downloads on npm, last 90 days: 75,633,739 weekly downloads as of Dec 5, 2026, +70.1% over 90 days.

7/30/90-day growth

webpack-virtual-modules weekly downloads growth on npm: +14.8% over 7 days, +21.1% over 30 days, +70.1% over 90 days.webpack-virtual-modulesWeekly downloads growth on npm75,633,739downloads / week now7-day growth+9,773,515 weekly downlo…+14.8%30-day growth+13,171,773 weekly downl…+21.1%90-day growth+31,162,334 weekly downl…+70.1%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
webpack-virtual-modules weekly downloads growth on npm: +14.8% over 7 days, +21.1% over 30 days, +70.1% over 90 days.

Ranking history

webpack-virtual-modules npm ranking history: currently #21 (by weekly downloads).webpack-virtual-modulesnpm ranking · by weekly downloads · Last 90 days#21current rank#10#20#30#40#50Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 17, 2026 – Dec 6, 2026 · 45 observations · Updated Dec 5, 2026pluginstats.com
webpack-virtual-modules npm ranking history: currently #21 (by weekly downloads).

Listing placement

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

Listing placement

Webpack plugins349 listings · 18 pages · page 1, #1 (overall #1)
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 (592)
Recent weekly downloads observations for webpack-virtual-modules
Date (UTC)Weekly downloadsChange vs. previous
75,633,739+934.4K
74,699,345+3.3M
71,448,883+3M
68,426,941+1.3M
67,167,675+1M
66,160,049+387.9K
65,772,147-88.1K
65,860,224-813K
66,673,229-2.3M
68,980,063-2.2M
71,168,237-876.8K
72,045,050-167.2K
72,212,245-401.5K
72,613,729—

Similar npm Webpack plugins plugins

All 20 webpack-virtual-modules 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/webpack-virtual-modules. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.