React Webpack配置babel 报错 Invalid configuration object. Webpack has been initialised using a configu

匿名 (未验证) 提交于 2019-12-03 00:30:01

报错:Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.

注意事项:


var path =require('path');

module.exports = {
mode: 'production',
//入口文件
entry:'./app/index.js',
//出口文件
output:{
filename:'index.js',
path:path.resolve(__dirname,'dist'),
publicPath:'temp/'
},
devServer:{
contentBase:'./',
host:'localhost',
compress:true,
port:1717
},
module:{
rules:[
{
test:/\.js$/,
exclude:/node_modules/,
loaders:"babel-loader",
query:{
presets:['es2015','react']
}
}
]
}
}


易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!