auto-require-webpack-plugin weekly downloads statistics
By nilennoct · npm · Webpack plugins
Webpack plugin to automatically require the module itself
auto-require-webpack-plugin has 77 recorded weekly downloads on npm, an increase of 71.1% over the past 30 days, ranking #2675 of 3,247 tracked listings.
About auto-require-webpack-plugin
auto-require-webpack-plugin
Webpack plugin to automatically require the module itself, if module name defined. For Example:
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define("common/view", [], factory);
else if(typeof exports === 'object')
exports["common/view"] = factory();
else
root["common/view"] = factory();
})(this, function() {
/* Module code here */
});
// When using require, call the module automatically
typeof define === 'function' && define.amd && require(['common/view']);
Usage
new AutoRequirePlugin(options)
/* Use constructor options directly */
var options = true;
module.exports = {
plugins: [
new AutoRequirePlugin(options)
]
};
Or
/* Use `output.autoRequire` to set options */
var options = true;
module.exports = {
output: {
autoRequire: options
},
plugins: [
new AutoRequirePlugin()
]
};
There are two ways to configure AutoRequirePlugin: constructor's parameter or output.autoRequire. The latter will override constructor's parameter.
Examples
Type of options can be boolean, string, RegExp, function and Array.
Require all modules
module.exports = {
plugins: [
new AutoRequirePlugin(true)
]
};
Require module with specific name
module.exports = {
plugins: [
new AutoRequirePlugin('common/view')
]
};
Require module(s) matching regular expression
module.exports = {
plugins: [
new AutoRequirePlugin(/^common/)
]
};
Require module(s) testing by function
module.exports = {
plugins: [
new AutoRequirePlugin(function (moduleName) {
return moduleName.split('/').length > 2;
})
]
};
More complex case
module.exports = {
plugins: [
new AutoRequirePlugin([
/^pages\/.+/,
function (moduleName) {
return moduleName.indexOf('common') >= 0 && moduleName.indexOf('widgets') < 0;
}
])
]
};
Description from the npm listing.
- webpack
- plugin
- webpack-plugin
- require
- amd
- umd
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 (592)Similar npm Webpack plugins plugins
All 20 auto-require-webpack-plugin 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/auto-require-webpack-plugin. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.