使用插件
内置插件
在配置文件webpack.config.js里把插件属性加进去之后就能使用插件了:
var webpack = require("webpack");
module.exports = {
plugins:[
new webpack.ResolverPlugin([
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin("bower.json", ["main"])
],["normal","loader"])
]
};
如果不是内置的插件,那就先要安装:
npm install component-webpack-plugin
然后再用:
var ComponentPlugin = require("component-webpack-plugin");
module.exports = {
plugins:[
new ComponentPlugin()
]
}