Skip to content
This repository was archived by the owner on Aug 8, 2019. It is now read-only.

using plugins

Tobias Koppers edited this page May 16, 2014 · 10 revisions

Build-in plugins

Plugins are included in your module by using the plugins property in the webpack config.

var webpack = require("webpack"); // webpack should be in the node_modules directory, install if not.

module.exports = {
  plugins: [
    new webpack.ResolverPlugin([
      new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin("bower.json", ["main"])
    ], ["normal", "loader"])
  ]
};

Other plugins

Plugins that are not built-in may be installed via npm if published there, or by other means if not:

npm install component-webpack-plugin

which can then be used as follows:

var ComponentPlugin = require("component-webpack-plugin");
module.exports = {
    plugins: [
        new ComponentPlugin();
    ]
}

See also

Clone this wiki locally