Recently i setup a webpack-dev-server by watching a tutorial. I did exactly what exactly he did in the video
I expected that It will start a Live server, but it didn’t. I already check the internet but nothing good happenedenter image description here
Advertisement
Answer
Please refer to this link: https://webpack.js.org/configuration/dev-server/#publicpath
Since Webpack has been migrated from v3 to v4 so the syntax is different.
You need to change your devServer
configs as below:
JavaScript
x
7
1
devServer: {
2
static: {
3
directory: path.resolve(__dirname, "static"),
4
publicPath: "/static-public-path/",
5
},
6
},
7