Commit 17ab11e2 authored by Dan Abramov's avatar Dan Abramov
Browse files

Add an unobtrusive log when server disconnects

parent e872907b
No related merge requests found
Showing with 9 additions and 3 deletions
+9 -3
...@@ -130,9 +130,15 @@ var connection = new SockJS(url.format({ ...@@ -130,9 +130,15 @@ var connection = new SockJS(url.format({
// Hardcoded in WebpackDevServer // Hardcoded in WebpackDevServer
pathname: '/sockjs-node' pathname: '/sockjs-node'
})); }));
// Note: unlike WebpackDevServer's built-in client,
// we don't handle disconnect. If connection fails, // Unlike WebpackDevServer client, we won't try to reconnect
// just leave it instead of spamming the console. // to avoid spamming the console. Disconnect usually happens
// when developer stops the server.
connection.onclose = function() {
console.info(
'The development server has disconnected.\nRefresh the page if necessary.'
);
};
// Remember some state related to hot module replacement. // Remember some state related to hot module replacement.
var isFirstCompilation = true; var isFirstCompilation = true;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment