I dont understand why webpack
needs a output.publicPath
property when working with HMR
, I set the devServer to serve files from same directory of output.path, if I don't put output.publicPath
, then it shows me this error:
Please explain to me what exactly output.publicPath
does.
Thanks in advance and I'm sorry for my english.
I got it!, the ouput.path property is a place in the server where webpack will put the bundle file, but the publicPath is the place where the browser will ask for files when needed (in this case, the json manifiest and updated chunks for HMR), if you dont put that, then the browser wont know where to ask for that and the devServer will return a 404 not found.
I hope this to be useful for someone else with the same problem.