load-webpack-plugins
Conveniently Load Webpack Plugins from Package Dependencies or Webpack Builtins.
Install
$ npm install --save-dev load-webpack-plugins
Usage
Loading Webpack Built in Plugins
Default or Built in Webpack plugins can be loaded without the nested path references.
Example:
$ $ $
Please refer plugins.json for current list of supported built in plugins.
Loading from package dependencies
Given a package.json
file that has some dependencies
or devDependencies
within:
OR
Adding this to your webpack.config.js
:
var webpackPlugins = ; var $ = ;
Or, even shorter
var $ = ;
would result in all the webpack plugins in package.json
to be loaded on $
variable.
You can now access the plugins like so:
$; $;
Todo
- Support Webpack Plugins published as Private/Scoped NPM Packages
- [] Support Custom patterns for Plugins Discovery
- [] Support Custom name transform function in option.
Credit
Thanks to @sindresorhus for awesome load-grunt-plugins