configuration.module has an unknown property ‘plugins
1、問題原因:是webpack版本不同,webpack.config.js配置不一樣
2、解決方案:webpack.config.js(主要看plugins位置)
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports ={
devtool: 'eval-source-map',
entry:__dirname+'/app/main.js',
output:{
path:__dirname +'/public',
filename:"bundle1.js"
},
module: {
loaders: [
{
test: /\.json$/,
loader: "json-loader"
},
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['es2015','react']
}
},
{
test: /\.css$/,
loader: 'style-loader!css-loader?modules'
}
],
},
plugins: [
new HtmlWebpackPlugin({
template: __dirname + "/app/index.tmpl.html"
})
],
devServer:{
contentBase: "./public",
historyApiFallback: true,
port:'8090',
inline: true
},
};
附:淺談webpack的重要功能——Plugins
http://blog.csdn.net/zhouziyu2011/article/details/69053647