配置是这样的:
var path = require('path');
var htmlWebpackPlugin=require("html-webpack-plugin");
module.exports={
entry:"./src/app.js",
output:{
path:path.resolve(__dirname, './dist'),
filename:"js/[name]-bundle.js"
},
module:{
loaders:[
{
test:/\.js$/,
loader:"babel-loader",
exclude:"./node_modules/",
options:{
"presets":["env"]
}
}
]
},
plugins:[
new htmlWebpackPlugin({
filename:"index.html",
template:"index.html",
inject:"body"
})
]
}
可是还是报错如下:
exclude : __dirname +"./node_modules/", 改变路径。
加一个配置文件