I am learning about webpack today. Then learn about the problems with building a local server.
this is my configuration code:
module.exports = {
devtool:"eval-source-map",
entry: __dirname + "/app/main.js",//
output: {
path: __dirname + "./public",//
filename: "bundle.js",
devServer:{
contentBase:"/public",
historyApiFallback:true,
inline:true
}
}
}
this is the code for package.json:
{
"name": "webpack",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"webpack": "^4.6.0"
},
"devDependencies": {
"webpack-cli": "^2.1.2",
"webpack-dev-server": "^3.1.4"
},
"scripts": {
"start": "webpack",
"test": "echo \"Error: no test specified\" && exit 1",
"server": "webpack-dev-server --open"
},
"author": ",
" license ":" ISC "
}
after reading the error report, I really didn"t understand it. I searched the Internet for a long time, but I still didn"t get it. Please give me your advice.