Enable watchContentBase for webpack-dev-server (#1546)

Resolves #1508
This commit is contained in:
Kees Kluskens
2017-02-15 03:41:31 +01:00
committed by Joe Haddad
parent fc49946ccb
commit 1d5a277367
2 changed files with 6 additions and 0 deletions

View File

@@ -252,6 +252,10 @@ connection.onmessage = function(e) {
case 'ok':
handleSuccess();
break;
case 'content-changed':
// Triggered when a file from `contentBase` changed.
window.location.reload();
break;
case 'warnings':
handleWarnings(message.data);
break;

View File

@@ -249,6 +249,8 @@ function runDevServer(host, port, protocol) {
// for some reason broken when imported through Webpack. If you just want to
// use an image, put it in `src` and `import` it from JavaScript instead.
contentBase: paths.appPublic,
// By default files from `contentBase` will not trigger a page reload.
watchContentBase: true,
// Enable hot reloading server. It will provide /sockjs-node/ endpoint
// for the WebpackDevServer client so it can learn when the files were
// updated. The WebpackDevServer client is included as an entry point