Hi.
I have a problem with contentBase
and generated hot-update.json
paths.
config:
...
entry: [
'webpack/hot/dev-server',
...
],
contentBase: './www/',
output: { filename: 'www/index.js' },
plugins: [
new webpack.HotModuleReplacementPlugin()
],
recordsPath: path.resolve('www/webpack.records.json')
...
www/index.html:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
</head>
<body>
<div id="app"></div>
<script src="index.js"></script>
</body>
</html>
Even with recordsPath
(is it works at all?) webpack is generatin and serving *.hot-update.json
files from the root, but trying to fetch them from the www
(which is ok accroding to the config) so I get http://localhost:8080/www/31e32dd1f3e9bd7ea7fa.hot-update.json 404 (Not Found)
errors.
just got it working with this config:
serving www/index.html:
and opening
http://localhost:8080/webpack-dev-server/www
in the browser.but I can’t understand why it’s working 🙂
publicPath: '/'
looks like a hack for me, I expecting to gethot-update.json
fromwww/
, likewww/index.js
, but: