diff --git a/client-src/index.js b/client-src/index.js index eb2b5fb8b3..7ea51c0c63 100644 --- a/client-src/index.js +++ b/client-src/index.js @@ -94,8 +94,6 @@ if (typeof parsedResourceQuery.reconnect !== "undefined") { options.reconnect = Number(parsedResourceQuery.reconnect); } -logEnabledFeatures(enabledFeatures); - /** * @param {string} level */ @@ -111,6 +109,8 @@ if (options.logging) { setAllLogLevel(options.logging); } +logEnabledFeatures(enabledFeatures); + self.addEventListener("beforeunload", () => { status.isUnloading = true; }); diff --git a/test/e2e/__snapshots__/logging.test.js.snap.webpack4 b/test/e2e/__snapshots__/logging.test.js.snap.webpack4 index 7e6e26c1e0..59282da8b7 100644 --- a/test/e2e/__snapshots__/logging.test.js.snap.webpack4 +++ b/test/e2e/__snapshots__/logging.test.js.snap.webpack4 @@ -116,7 +116,6 @@ Array [ exports[`logging should work and log only error (sockjs) 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", "[webpack-dev-server] Errors while compiling. Reload prevented.", "[webpack-dev-server] ERROR @@ -126,7 +125,6 @@ Error from compilation", exports[`logging should work and log only error (ws) 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", "[webpack-dev-server] Errors while compiling. Reload prevented.", "[webpack-dev-server] ERROR @@ -160,7 +158,6 @@ Array [ exports[`logging should work and log warning and errors (sockjs) 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", "[webpack-dev-server] Warnings while compiling.", "[webpack-dev-server] WARNING @@ -173,7 +170,6 @@ Error from compilation", exports[`logging should work and log warning and errors (ws) 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", "[webpack-dev-server] Warnings while compiling.", "[webpack-dev-server] WARNING @@ -240,14 +236,12 @@ Array [ exports[`logging should work when the "client.logging" is "none" (sockjs) 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; exports[`logging should work when the "client.logging" is "none" (ws) 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; diff --git a/test/e2e/__snapshots__/logging.test.js.snap.webpack5 b/test/e2e/__snapshots__/logging.test.js.snap.webpack5 index 7e6e26c1e0..59282da8b7 100644 --- a/test/e2e/__snapshots__/logging.test.js.snap.webpack5 +++ b/test/e2e/__snapshots__/logging.test.js.snap.webpack5 @@ -116,7 +116,6 @@ Array [ exports[`logging should work and log only error (sockjs) 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", "[webpack-dev-server] Errors while compiling. Reload prevented.", "[webpack-dev-server] ERROR @@ -126,7 +125,6 @@ Error from compilation", exports[`logging should work and log only error (ws) 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", "[webpack-dev-server] Errors while compiling. Reload prevented.", "[webpack-dev-server] ERROR @@ -160,7 +158,6 @@ Array [ exports[`logging should work and log warning and errors (sockjs) 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", "[webpack-dev-server] Warnings while compiling.", "[webpack-dev-server] WARNING @@ -173,7 +170,6 @@ Error from compilation", exports[`logging should work and log warning and errors (ws) 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", "[webpack-dev-server] Warnings while compiling.", "[webpack-dev-server] WARNING @@ -240,14 +236,12 @@ Array [ exports[`logging should work when the "client.logging" is "none" (sockjs) 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; exports[`logging should work when the "client.logging" is "none" (ws) 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; diff --git a/test/e2e/__snapshots__/watch-files.test.js.snap.webpack4 b/test/e2e/__snapshots__/watch-files.test.js.snap.webpack4 index d0ff8ed1a9..8936bb5991 100644 --- a/test/e2e/__snapshots__/watch-files.test.js.snap.webpack4 +++ b/test/e2e/__snapshots__/watch-files.test.js.snap.webpack4 @@ -2,7 +2,6 @@ exports[`watchFiles option should not crash if file doesn't exist should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -13,7 +12,6 @@ exports[`watchFiles option should not crash if file doesn't exist should reload exports[`watchFiles option should work with array config should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -24,7 +22,6 @@ exports[`watchFiles option should work with array config should reload when file exports[`watchFiles option should work with object with multiple paths should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -35,7 +32,6 @@ exports[`watchFiles option should work with object with multiple paths should re exports[`watchFiles option should work with object with single path should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -60,7 +56,6 @@ Object { exports[`watchFiles option should work with options {"interval":400,"poll":200} should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -85,7 +80,6 @@ Object { exports[`watchFiles option should work with options {"poll":200} should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -110,7 +104,6 @@ Object { exports[`watchFiles option should work with options {"poll":true} should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -135,7 +128,6 @@ Object { exports[`watchFiles option should work with options {"usePolling":false,"interval":200,"poll":400} should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -160,7 +152,6 @@ Object { exports[`watchFiles option should work with options {"usePolling":false,"poll":200} should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -185,7 +176,6 @@ Object { exports[`watchFiles option should work with options {"usePolling":false,"poll":true} should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -210,7 +200,6 @@ Object { exports[`watchFiles option should work with options {"usePolling":false} should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -235,7 +224,6 @@ Object { exports[`watchFiles option should work with options {"usePolling":true,"interval":200,"poll":400} should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -260,7 +248,6 @@ Object { exports[`watchFiles option should work with options {"usePolling":true,"poll":200} should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -285,7 +272,6 @@ Object { exports[`watchFiles option should work with options {"usePolling":true} should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -296,7 +282,6 @@ exports[`watchFiles option should work with options {"usePolling":true} should r exports[`watchFiles option should work with string and glob should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -307,7 +292,6 @@ exports[`watchFiles option should work with string and glob should reload when f exports[`watchFiles option should work with string and path to directory should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -318,7 +302,6 @@ exports[`watchFiles option should work with string and path to directory should exports[`watchFiles option should work with string and path to file should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; diff --git a/test/e2e/__snapshots__/watch-files.test.js.snap.webpack5 b/test/e2e/__snapshots__/watch-files.test.js.snap.webpack5 index d0ff8ed1a9..8936bb5991 100644 --- a/test/e2e/__snapshots__/watch-files.test.js.snap.webpack5 +++ b/test/e2e/__snapshots__/watch-files.test.js.snap.webpack5 @@ -2,7 +2,6 @@ exports[`watchFiles option should not crash if file doesn't exist should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -13,7 +12,6 @@ exports[`watchFiles option should not crash if file doesn't exist should reload exports[`watchFiles option should work with array config should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -24,7 +22,6 @@ exports[`watchFiles option should work with array config should reload when file exports[`watchFiles option should work with object with multiple paths should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -35,7 +32,6 @@ exports[`watchFiles option should work with object with multiple paths should re exports[`watchFiles option should work with object with single path should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -60,7 +56,6 @@ Object { exports[`watchFiles option should work with options {"interval":400,"poll":200} should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -85,7 +80,6 @@ Object { exports[`watchFiles option should work with options {"poll":200} should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -110,7 +104,6 @@ Object { exports[`watchFiles option should work with options {"poll":true} should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -135,7 +128,6 @@ Object { exports[`watchFiles option should work with options {"usePolling":false,"interval":200,"poll":400} should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -160,7 +152,6 @@ Object { exports[`watchFiles option should work with options {"usePolling":false,"poll":200} should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -185,7 +176,6 @@ Object { exports[`watchFiles option should work with options {"usePolling":false,"poll":true} should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -210,7 +200,6 @@ Object { exports[`watchFiles option should work with options {"usePolling":false} should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -235,7 +224,6 @@ Object { exports[`watchFiles option should work with options {"usePolling":true,"interval":200,"poll":400} should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -260,7 +248,6 @@ Object { exports[`watchFiles option should work with options {"usePolling":true,"poll":200} should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -285,7 +272,6 @@ Object { exports[`watchFiles option should work with options {"usePolling":true} should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -296,7 +282,6 @@ exports[`watchFiles option should work with options {"usePolling":true} should r exports[`watchFiles option should work with string and glob should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -307,7 +292,6 @@ exports[`watchFiles option should work with string and glob should reload when f exports[`watchFiles option should work with string and path to directory should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `; @@ -318,7 +302,6 @@ exports[`watchFiles option should work with string and path to directory should exports[`watchFiles option should work with string and path to file should reload when file content is changed: console messages 1`] = ` Array [ - "[webpack-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay enabled.", "Hey.", ] `;