mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-24 05:05:53 +08:00
Add an unobtrusive log when server disconnects
This commit is contained in:
12
packages/react-dev-utils/webpackHotDevClient.js
vendored
12
packages/react-dev-utils/webpackHotDevClient.js
vendored
@@ -130,9 +130,15 @@ var connection = new SockJS(url.format({
|
||||
// Hardcoded in WebpackDevServer
|
||||
pathname: '/sockjs-node'
|
||||
}));
|
||||
// Note: unlike WebpackDevServer's built-in client,
|
||||
// we don't handle disconnect. If connection fails,
|
||||
// just leave it instead of spamming the console.
|
||||
|
||||
// Unlike WebpackDevServer client, we won't try to reconnect
|
||||
// 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.
|
||||
var isFirstCompilation = true;
|
||||
|
||||
Reference in New Issue
Block a user