forked from webpack/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
using plugins
Patryk Ziemkowski edited this page Jul 14, 2015
·
7 revisions
Plugins are included in your module by using the plugins property in the webpack config.
// webpack should be in the node_modules directory, install if not.
var webpack = require("webpack");
module.exports = {
plugins: [
new webpack.ResolverPlugin([
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin("bower.json", ["main"])
], ["normal", "loader"])
]
};
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()
]
}