Skip to content

Commit

Permalink
Enable watchContentBase for webpack-dev-server (facebook#1546)
Browse files Browse the repository at this point in the history
Resolves facebook#1508
  • Loading branch information
SpaceK33z authored and Timer committed Feb 15, 2017
1 parent 0706910 commit 3a1c3ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/react-dev-utils/webpackHotDevClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions packages/react-scripts/scripts/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3a1c3ac

Please sign in to comment.