From ba4acf1b3e4f7553a4b3dc8d0cfd4c8af1706201 Mon Sep 17 00:00:00 2001 From: Anton Dubrouski Date: Sun, 16 Mar 2025 14:19:27 +0300 Subject: [PATCH 1/3] feat: publicPath output --- lib/Server.js | 20 ++++++++++++++++--- .../__snapshots__/basic.test.js.snap.webpack5 | 7 +++++++ test/cli/basic.test.js | 15 ++++++++++++++ .../cli-output-public-path-config/foo.js | 3 +++ .../webpack.config.js | 11 ++++++++++ 5 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 test/fixtures/cli-output-public-path-config/foo.js create mode 100644 test/fixtures/cli-output-public-path-config/webpack.config.js diff --git a/lib/Server.js b/lib/Server.js index 80051e735e..6a1e858cac 100644 --- a/lib/Server.js +++ b/lib/Server.js @@ -2868,7 +2868,10 @@ class Server { return msg; }, }; - const useColor = getColorsOption(this.getCompilerOptions()); + + const compilerOptions = this.getCompilerOptions(); + + const useColor = getColorsOption(compilerOptions); const server = /** @type {S} */ (this.server); @@ -2883,8 +2886,19 @@ class Server { * @param {string} newHostname * @returns {string} */ - const prettyPrintURL = (newHostname) => - url.format({ protocol, hostname: newHostname, port, pathname: "/" }); + const prettyPrintURL = (newHostname) => { + const publicPath = compilerOptions.output.publicPath; + + return url.format({ + protocol, + hostname: newHostname, + port, + pathname: + typeof publicPath === "function" || publicPath === "auto" + ? "/" + : publicPath, + }); + }; let host; let localhost; diff --git a/test/cli/__snapshots__/basic.test.js.snap.webpack5 b/test/cli/__snapshots__/basic.test.js.snap.webpack5 index a5e1d16264..958d6f0a60 100644 --- a/test/cli/__snapshots__/basic.test.js.snap.webpack5 +++ b/test/cli/__snapshots__/basic.test.js.snap.webpack5 @@ -8,6 +8,13 @@ exports[`basic basic should accept the promise function of webpack.config.js: st [webpack-dev-server] Content not from webpack is served from '/public' directory" `; +exports[`basic basic should respect output.publicPath config option in URL's output: stderr 1`] = ` +" [webpack-dev-server] Project is running at: + Loopback: http://localhost:/, http://:/, http://[]:/ + [webpack-dev-server] On Your Network (IPv4): http://:/foo/ + [webpack-dev-server] Content not from webpack is served from '/public' directory" +`; + exports[`basic basic should work using "--host localhost --port ": stderr 1`] = ` " [webpack-dev-server] Project is running at: Loopback: http://localhost:/, http://:/, http://[]:/ diff --git a/test/cli/basic.test.js b/test/cli/basic.test.js index 98a5e33c79..27b4c8b414 100644 --- a/test/cli/basic.test.js +++ b/test/cli/basic.test.js @@ -57,6 +57,21 @@ describe("basic", () => { expect(normalizeStderr(stderr, { ipv6: true })).toMatchSnapshot("stderr"); }); + it("should respect output.publicPath config option in URL's output", async () => { + const { exitCode, stderr } = await testBin([ + "--config", + path.resolve( + __dirname, + "../fixtures/cli-output-public-path-config/webpack.config.js", + ), + "--port", + port, + ]); + + expect(exitCode).toEqual(0); + expect(normalizeStderr(stderr)).toMatchSnapshot("stderr"); + }); + it("should work using multi compiler mode", async () => { const { exitCode, stderr } = await testBin([ "--config", diff --git a/test/fixtures/cli-output-public-path-config/foo.js b/test/fixtures/cli-output-public-path-config/foo.js new file mode 100644 index 0000000000..5940e9197c --- /dev/null +++ b/test/fixtures/cli-output-public-path-config/foo.js @@ -0,0 +1,3 @@ +"use strict"; + +console.log("i am foo!"); diff --git a/test/fixtures/cli-output-public-path-config/webpack.config.js b/test/fixtures/cli-output-public-path-config/webpack.config.js new file mode 100644 index 0000000000..ab340d5ea1 --- /dev/null +++ b/test/fixtures/cli-output-public-path-config/webpack.config.js @@ -0,0 +1,11 @@ +"use strict"; + +const { join } = require("path"); + +module.exports = { + mode: "development", + entry: join(__dirname, "foo.js"), + output: { + publicPath: "/foo/", + }, +}; From 89eb799e49eeb8b218e446eca7ad87cbaa858515 Mon Sep 17 00:00:00 2001 From: Anton Dubrouski Date: Tue, 25 Mar 2025 14:15:26 +0300 Subject: [PATCH 2/3] feat: add info message when public path equals 'auto' or function --- lib/Server.js | 11 ++++++ .../__snapshots__/basic.test.js.snap.webpack5 | 28 ++++++++++++--- .../bonjour-option.test.js.snap.webpack5 | 9 +++-- .../colors.test.js.snap.webpack5 | 15 +++++--- ...ryApiFallback-option.test.js.snap.webpack5 | 3 +- .../host-option.test.js.snap.webpack5 | 27 +++++++++----- .../ipc-option.test.js.snap.webpack5 | 6 ++-- .../port-option.test.js.snap.webpack5 | 6 ++-- .../server-option.test.js.snap.webpack5 | 27 +++++++++----- .../static-option.test.js.snap.webpack5 | 36 ++++++++++++------- .../watchFiles-option.test.js.snap.webpack5 | 9 +++-- test/cli/basic.test.js | 30 ++++++++++++++++ .../cli-output-public-path-auto-config/foo.js | 3 ++ .../webpack.config.js | 11 ++++++ .../foo.js | 3 ++ .../webpack.config.js | 11 ++++++ 16 files changed, 185 insertions(+), 50 deletions(-) create mode 100644 test/fixtures/cli-output-public-path-auto-config/foo.js create mode 100644 test/fixtures/cli-output-public-path-auto-config/webpack.config.js create mode 100644 test/fixtures/cli-output-public-path-function-config/foo.js create mode 100644 test/fixtures/cli-output-public-path-function-config/webpack.config.js diff --git a/lib/Server.js b/lib/Server.js index 6a1e858cac..df04039f41 100644 --- a/lib/Server.js +++ b/lib/Server.js @@ -3045,6 +3045,17 @@ class Server { `Broadcasting "${bonjourProtocol}" with subtype of "webpack" via ZeroConf DNS (Bonjour)`, ); } + + const publicPath = compilerOptions.output.publicPath; + + const isOnTheFlyDefinedPublicPath = + typeof publicPath === "function" || publicPath === "auto"; + + if (isOnTheFlyDefinedPublicPath) { + this.logger.info( + `You probably have a custom public path, please navigate in your browser to the point that you required`, + ); + } } /** diff --git a/test/cli/__snapshots__/basic.test.js.snap.webpack5 b/test/cli/__snapshots__/basic.test.js.snap.webpack5 index 958d6f0a60..26cbc12d00 100644 --- a/test/cli/__snapshots__/basic.test.js.snap.webpack5 +++ b/test/cli/__snapshots__/basic.test.js.snap.webpack5 @@ -5,7 +5,8 @@ exports[`basic basic should accept the promise function of webpack.config.js: st Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`basic basic should respect output.publicPath config option in URL's output: stderr 1`] = ` @@ -15,10 +16,27 @@ exports[`basic basic should respect output.publicPath config option in URL's out [webpack-dev-server] Content not from webpack is served from '/public' directory" `; +exports[`basic basic should show info message when output.publicPath equals 'auto': stderr 1`] = ` +" [webpack-dev-server] Project is running at: + Loopback: http://localhost:/, http://:/, http://[]:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" +`; + +exports[`basic basic should show info message when output.publicPath is function: stderr 1`] = ` +" [webpack-dev-server] Project is running at: + Loopback: http://localhost:/, http://:/, http://[]:/ + [webpack-dev-server] On Your Network (IPv4): http://:/ + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" +`; + exports[`basic basic should work using "--host localhost --port ": stderr 1`] = ` " [webpack-dev-server] Project is running at: Loopback: http://localhost:/, http://:/, http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`basic basic should work using multi compiler mode: stderr 1`] = ` @@ -26,7 +44,8 @@ exports[`basic basic should work using multi compiler mode: stderr 1`] = ` Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`basic basic should work: stderr 1`] = ` @@ -34,7 +53,8 @@ exports[`basic basic should work: stderr 1`] = ` Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`basic should output help should generate correct cli flags 1`] = ` diff --git a/test/cli/__snapshots__/bonjour-option.test.js.snap.webpack5 b/test/cli/__snapshots__/bonjour-option.test.js.snap.webpack5 index 6c449cde89..f319b348c6 100644 --- a/test/cli/__snapshots__/bonjour-option.test.js.snap.webpack5 +++ b/test/cli/__snapshots__/bonjour-option.test.js.snap.webpack5 @@ -8,7 +8,8 @@ exports[`"bonjour" CLI option should work using "--bonjour and --server-type=htt [webpack-dev-server] On Your Network (IPv4): https://:/ [webpack-dev-server] On Your Network (IPv6): https://[]:/ [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] Broadcasting "https" with subtype of "webpack" via ZeroConf DNS (Bonjour)" + [webpack-dev-server] Broadcasting "https" with subtype of "webpack" via ZeroConf DNS (Bonjour) + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"bonjour" CLI option should work using "--bonjour" 1`] = ` @@ -17,7 +18,8 @@ exports[`"bonjour" CLI option should work using "--bonjour" 1`] = ` [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] Broadcasting "http" with subtype of "webpack" via ZeroConf DNS (Bonjour)" + [webpack-dev-server] Broadcasting "http" with subtype of "webpack" via ZeroConf DNS (Bonjour) + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"bonjour" CLI option should work using "--no-bonjour" 1`] = ` @@ -25,5 +27,6 @@ exports[`"bonjour" CLI option should work using "--no-bonjour" 1`] = ` Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; diff --git a/test/cli/__snapshots__/colors.test.js.snap.webpack5 b/test/cli/__snapshots__/colors.test.js.snap.webpack5 index fd01bfe554..2539696cdf 100644 --- a/test/cli/__snapshots__/colors.test.js.snap.webpack5 +++ b/test/cli/__snapshots__/colors.test.js.snap.webpack5 @@ -5,7 +5,8 @@ exports[`colors should work and do not use colors using configuration with disab Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`colors should work do not use colors using "--no-color": stderr 1`] = ` @@ -13,7 +14,8 @@ exports[`colors should work do not use colors using "--no-color": stderr 1`] = ` Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`colors should work use colors by default: stderr 1`] = ` @@ -21,7 +23,8 @@ exports[`colors should work use colors by default: stderr 1`] = ` Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`colors should work use colors using "--color": stderr 1`] = ` @@ -29,7 +32,8 @@ exports[`colors should work use colors using "--color": stderr 1`] = ` Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`colors should work use colors using configuration with enabled colors: stderr 1`] = ` @@ -37,5 +41,6 @@ exports[`colors should work use colors using configuration with enabled colors: Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; diff --git a/test/cli/__snapshots__/historyApiFallback-option.test.js.snap.webpack5 b/test/cli/__snapshots__/historyApiFallback-option.test.js.snap.webpack5 index bfb7b85086..a7a3923181 100644 --- a/test/cli/__snapshots__/historyApiFallback-option.test.js.snap.webpack5 +++ b/test/cli/__snapshots__/historyApiFallback-option.test.js.snap.webpack5 @@ -6,7 +6,8 @@ exports[`"historyApiFallback" CLI option should work using "--history-api-fallba [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] 404s will fallback to '/index.html'" + [webpack-dev-server] 404s will fallback to '/index.html' + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"historyApiFallback" CLI option should work using "--no-history-api-fallback" 1`] = ` diff --git a/test/cli/__snapshots__/host-option.test.js.snap.webpack5 b/test/cli/__snapshots__/host-option.test.js.snap.webpack5 index 54a5e6b310..839ab516d5 100644 --- a/test/cli/__snapshots__/host-option.test.js.snap.webpack5 +++ b/test/cli/__snapshots__/host-option.test.js.snap.webpack5 @@ -5,25 +5,29 @@ exports[`"host" CLI option should work using "--host ::" (IPv6): stderr 1`] = ` Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"host" CLI option should work using "--host ::1" (IPv6): stderr 1`] = ` " [webpack-dev-server] Project is running at: Loopback: http://localhost:/, http://:/, http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"host" CLI option should work using "--host ::1" (IPv6): stderr 2`] = ` " [webpack-dev-server] Project is running at: Loopback: http://localhost:/, http://:/, http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"host" CLI option should work using "--host ": stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] On Your Network (IPv4): http://:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"host" CLI option should work using "--host 0.0.0.0" (IPv4): stderr 1`] = ` @@ -31,29 +35,34 @@ exports[`"host" CLI option should work using "--host 0.0.0.0" (IPv4): stderr 1`] Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"host" CLI option should work using "--host 127.0.0.1" (IPv4): stderr 1`] = ` " [webpack-dev-server] Project is running at: Loopback: http://localhost:/, http://:/, http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"host" CLI option should work using "--host local-ip": stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] On Your Network (IPv4): http://:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"host" CLI option should work using "--host local-ipv4": stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] On Your Network (IPv4): http://:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"host" CLI option should work using "--host localhost": stderr 1`] = ` " [webpack-dev-server] Project is running at: Loopback: http://localhost:/, http://:/, http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; diff --git a/test/cli/__snapshots__/ipc-option.test.js.snap.webpack5 b/test/cli/__snapshots__/ipc-option.test.js.snap.webpack5 index a74aa00abe..fef5939ec7 100644 --- a/test/cli/__snapshots__/ipc-option.test.js.snap.webpack5 +++ b/test/cli/__snapshots__/ipc-option.test.js.snap.webpack5 @@ -2,10 +2,12 @@ exports[`"ipc" CLI option should work using "--ipc": stderr 1`] = ` " [webpack-dev-server] Project is running at: "/webpack-dev-server.sock" - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"ipc" CLI option should work using "--ipc=": stderr 1`] = ` " [webpack-dev-server] Project is running at: "/webpack-dev-server.cli.sock" - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; diff --git a/test/cli/__snapshots__/port-option.test.js.snap.webpack5 b/test/cli/__snapshots__/port-option.test.js.snap.webpack5 index f4370b9118..adcf19a538 100644 --- a/test/cli/__snapshots__/port-option.test.js.snap.webpack5 +++ b/test/cli/__snapshots__/port-option.test.js.snap.webpack5 @@ -5,7 +5,8 @@ exports[`"port" CLI option should work using "--port ": stderr 1`] = ` Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"port" CLI option should work using "--port auto": stderr 1`] = ` @@ -13,5 +14,6 @@ exports[`"port" CLI option should work using "--port auto": stderr 1`] = ` Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; diff --git a/test/cli/__snapshots__/server-option.test.js.snap.webpack5 b/test/cli/__snapshots__/server-option.test.js.snap.webpack5 index f3efb017ab..afbebe9661 100644 --- a/test/cli/__snapshots__/server-option.test.js.snap.webpack5 +++ b/test/cli/__snapshots__/server-option.test.js.snap.webpack5 @@ -7,7 +7,8 @@ exports[`"server" CLI options should work using "--no-server-options-request-cer Loopback: https://localhost:/, https://:/, https://[]:/ [webpack-dev-server] On Your Network (IPv4): https://:/ [webpack-dev-server] On Your Network (IPv6): https://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"server" CLI options should work using "--server-options-key --server-options-pfx --server-options-passphrase webpack-dev-server --server-options-cert --server-options-ca " 1`] = ` @@ -15,7 +16,8 @@ exports[`"server" CLI options should work using "--server-options-key --s Loopback: https://localhost:/, https://:/, https://[]:/ [webpack-dev-server] On Your Network (IPv4): https://:/ [webpack-dev-server] On Your Network (IPv6): https://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"server" CLI options should work using "--server-options-key --server-options-pfx --server-options-passphrase webpack-dev-server --server-options-cert " 1`] = ` @@ -23,7 +25,8 @@ exports[`"server" CLI options should work using "--server-options-key --s Loopback: https://localhost:/, https://:/, https://[]:/ [webpack-dev-server] On Your Network (IPv4): https://:/ [webpack-dev-server] On Your Network (IPv6): https://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"server" CLI options should work using "--server-options-key --server-options-pfx --server-options-passphrase webpack-dev-server --server-options-cert " 2`] = ` @@ -31,7 +34,8 @@ exports[`"server" CLI options should work using "--server-options-key --s Loopback: https://localhost:/, https://:/, https://[]:/ [webpack-dev-server] On Your Network (IPv4): https://:/ [webpack-dev-server] On Your Network (IPv6): https://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"server" CLI options should work using "--server-options-key-reset --server-options-key --server-options-pfx-reset --server-options-pfx --server-options-passphrase webpack-dev-server --server-options-cert-reset --server-options-cert --server-options-ca-reset --server-options-ca " 1`] = ` @@ -39,7 +43,8 @@ exports[`"server" CLI options should work using "--server-options-key-reset --se Loopback: https://localhost:/, https://:/, https://[]:/ [webpack-dev-server] On Your Network (IPv4): https://:/ [webpack-dev-server] On Your Network (IPv6): https://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"server" CLI options should work using "--server-options-request-cert" 1`] = ` @@ -49,7 +54,8 @@ exports[`"server" CLI options should work using "--server-options-request-cert" Loopback: https://localhost:/, https://:/, https://[]:/ [webpack-dev-server] On Your Network (IPv4): https://:/ [webpack-dev-server] On Your Network (IPv6): https://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"server" CLI options should work using "--server-type http" 1`] = ` @@ -57,7 +63,8 @@ exports[`"server" CLI options should work using "--server-type http" 1`] = ` Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"server" CLI options should work using "--server-type https" 1`] = ` @@ -67,7 +74,8 @@ exports[`"server" CLI options should work using "--server-type https" 1`] = ` Loopback: https://localhost:/, https://:/, https://[]:/ [webpack-dev-server] On Your Network (IPv4): https://:/ [webpack-dev-server] On Your Network (IPv6): https://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"server" CLI options should work using "--server-type spdy" 1`] = ` @@ -77,5 +85,6 @@ exports[`"server" CLI options should work using "--server-type spdy" 1`] = ` Loopback: https://localhost:/, https://:/, https://[]:/ [webpack-dev-server] On Your Network (IPv4): https://:/ [webpack-dev-server] On Your Network (IPv6): https://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; diff --git a/test/cli/__snapshots__/static-option.test.js.snap.webpack5 b/test/cli/__snapshots__/static-option.test.js.snap.webpack5 index dbcfba7e20..27529f0584 100644 --- a/test/cli/__snapshots__/static-option.test.js.snap.webpack5 +++ b/test/cli/__snapshots__/static-option.test.js.snap.webpack5 @@ -5,7 +5,8 @@ exports[`"static" CLI option should work using "--no-static-serve-index": stderr Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"static" CLI option should work using "--no-static-watch": stderr 1`] = ` @@ -13,7 +14,8 @@ exports[`"static" CLI option should work using "--no-static-watch": stderr 1`] = Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"static" CLI option should work using "--static new-static --static other-static": stderr 1`] = ` @@ -21,7 +23,8 @@ exports[`"static" CLI option should work using "--static new-static --static oth Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from 'new-static, other-static' directory" + [webpack-dev-server] Content not from webpack is served from 'new-static, other-static' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"static" CLI option should work using "--static new-static": stderr 1`] = ` @@ -29,7 +32,8 @@ exports[`"static" CLI option should work using "--static new-static": stderr 1`] Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from 'new-static' directory" + [webpack-dev-server] Content not from webpack is served from 'new-static' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"static" CLI option should work using "--static": stderr 1`] = ` @@ -37,7 +41,8 @@ exports[`"static" CLI option should work using "--static": stderr 1`] = ` Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"static" CLI option should work using "--static-directory static-dir": stderr 1`] = ` @@ -45,7 +50,8 @@ exports[`"static" CLI option should work using "--static-directory static-dir": Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from 'static-dir' directory" + [webpack-dev-server] Content not from webpack is served from 'static-dir' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"static" CLI option should work using "--static-public-path /public": stderr 1`] = ` @@ -53,7 +59,8 @@ exports[`"static" CLI option should work using "--static-public-path /public": s Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"static" CLI option should work using "--static-public-path-reset": stderr 1`] = ` @@ -61,7 +68,8 @@ exports[`"static" CLI option should work using "--static-public-path-reset": std Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"static" CLI option should work using "--static-reset --static-directory new-static-directory": stderr 1`] = ` @@ -69,7 +77,8 @@ exports[`"static" CLI option should work using "--static-reset --static-director Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from 'new-static-directory' directory" + [webpack-dev-server] Content not from webpack is served from 'new-static-directory' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"static" CLI option should work using "--static-reset": stderr 1`] = ` @@ -77,7 +86,8 @@ exports[`"static" CLI option should work using "--static-reset": stderr 1`] = ` Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from 'new-static-after-reset' directory" + [webpack-dev-server] Content not from webpack is served from 'new-static-after-reset' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"static" CLI option should work using "--static-serve-index": stderr 1`] = ` @@ -85,7 +95,8 @@ exports[`"static" CLI option should work using "--static-serve-index": stderr 1` Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"static" CLI option should work using "--static-watch": stderr 1`] = ` @@ -93,5 +104,6 @@ exports[`"static" CLI option should work using "--static-watch": stderr 1`] = ` Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; diff --git a/test/cli/__snapshots__/watchFiles-option.test.js.snap.webpack5 b/test/cli/__snapshots__/watchFiles-option.test.js.snap.webpack5 index e01922ddab..0b04a59828 100644 --- a/test/cli/__snapshots__/watchFiles-option.test.js.snap.webpack5 +++ b/test/cli/__snapshots__/watchFiles-option.test.js.snap.webpack5 @@ -5,7 +5,8 @@ exports[`"watchFiles" CLI option should work using "--watch-files --watc Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"watchFiles" CLI option should work using "--watch-files ": stderr 1`] = ` @@ -13,7 +14,8 @@ exports[`"watchFiles" CLI option should work using "--watch-files ": stde Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; exports[`"watchFiles" CLI option should work using "--watch-files-reset --watch-files ": stderr 1`] = ` @@ -21,5 +23,6 @@ exports[`"watchFiles" CLI option should work using "--watch-files-reset --watch- Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory" + [webpack-dev-server] Content not from webpack is served from '/public' directory + [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" `; diff --git a/test/cli/basic.test.js b/test/cli/basic.test.js index 27b4c8b414..5632203c41 100644 --- a/test/cli/basic.test.js +++ b/test/cli/basic.test.js @@ -72,6 +72,36 @@ describe("basic", () => { expect(normalizeStderr(stderr)).toMatchSnapshot("stderr"); }); + it("should show info message when output.publicPath equals 'auto'", async () => { + const { exitCode, stderr } = await testBin([ + "--config", + path.resolve( + __dirname, + "../fixtures/cli-output-public-path-auto-config/webpack.config.js", + ), + "--port", + port, + ]); + + expect(exitCode).toEqual(0); + expect(normalizeStderr(stderr)).toMatchSnapshot("stderr"); + }); + + it("should show info message when output.publicPath is function", async () => { + const { exitCode, stderr } = await testBin([ + "--config", + path.resolve( + __dirname, + "../fixtures/cli-output-public-path-function-config/webpack.config.js", + ), + "--port", + port, + ]); + + expect(exitCode).toEqual(0); + expect(normalizeStderr(stderr)).toMatchSnapshot("stderr"); + }); + it("should work using multi compiler mode", async () => { const { exitCode, stderr } = await testBin([ "--config", diff --git a/test/fixtures/cli-output-public-path-auto-config/foo.js b/test/fixtures/cli-output-public-path-auto-config/foo.js new file mode 100644 index 0000000000..5940e9197c --- /dev/null +++ b/test/fixtures/cli-output-public-path-auto-config/foo.js @@ -0,0 +1,3 @@ +"use strict"; + +console.log("i am foo!"); diff --git a/test/fixtures/cli-output-public-path-auto-config/webpack.config.js b/test/fixtures/cli-output-public-path-auto-config/webpack.config.js new file mode 100644 index 0000000000..091d2255ad --- /dev/null +++ b/test/fixtures/cli-output-public-path-auto-config/webpack.config.js @@ -0,0 +1,11 @@ +"use strict"; + +const { join } = require("path"); + +module.exports = { + mode: "development", + entry: join(__dirname, "foo.js"), + output: { + publicPath: "auto", + }, +}; diff --git a/test/fixtures/cli-output-public-path-function-config/foo.js b/test/fixtures/cli-output-public-path-function-config/foo.js new file mode 100644 index 0000000000..5940e9197c --- /dev/null +++ b/test/fixtures/cli-output-public-path-function-config/foo.js @@ -0,0 +1,3 @@ +"use strict"; + +console.log("i am foo!"); diff --git a/test/fixtures/cli-output-public-path-function-config/webpack.config.js b/test/fixtures/cli-output-public-path-function-config/webpack.config.js new file mode 100644 index 0000000000..4567b9ae39 --- /dev/null +++ b/test/fixtures/cli-output-public-path-function-config/webpack.config.js @@ -0,0 +1,11 @@ +"use strict"; + +const { join } = require("path"); + +module.exports = { + mode: "development", + entry: join(__dirname, "foo.js"), + output: { + publicPath: () => "/any-public-path", + }, +}; From 2e68d84c567b72145aed4d1cb275486d2a6418f9 Mon Sep 17 00:00:00 2001 From: Anton Dubrouski Date: Wed, 2 Apr 2025 19:03:29 +0300 Subject: [PATCH 3/3] feat: show info message only if publicPath is function --- lib/Server.js | 7 +--- .../__snapshots__/basic.test.js.snap.webpack5 | 20 +++-------- .../bonjour-option.test.js.snap.webpack5 | 9 ++--- .../colors.test.js.snap.webpack5 | 15 +++----- ...ryApiFallback-option.test.js.snap.webpack5 | 3 +- .../host-option.test.js.snap.webpack5 | 27 +++++--------- .../ipc-option.test.js.snap.webpack5 | 6 ++-- .../port-option.test.js.snap.webpack5 | 6 ++-- .../server-option.test.js.snap.webpack5 | 30 ++++++---------- .../static-option.test.js.snap.webpack5 | 36 +++++++------------ .../watchFiles-option.test.js.snap.webpack5 | 9 ++--- test/cli/basic.test.js | 15 -------- .../cli-output-public-path-auto-config/foo.js | 3 -- .../webpack.config.js | 11 ------ 14 files changed, 52 insertions(+), 145 deletions(-) delete mode 100644 test/fixtures/cli-output-public-path-auto-config/foo.js delete mode 100644 test/fixtures/cli-output-public-path-auto-config/webpack.config.js diff --git a/lib/Server.js b/lib/Server.js index 491cae1cf4..2f5fbe27f9 100644 --- a/lib/Server.js +++ b/lib/Server.js @@ -3077,12 +3077,7 @@ class Server { ); } - const publicPath = compilerOptions.output.publicPath; - - const isOnTheFlyDefinedPublicPath = - typeof publicPath === "function" || publicPath === "auto"; - - if (isOnTheFlyDefinedPublicPath) { + if (typeof compilerOptions.output.publicPath === "function") { this.logger.info( `You probably have a custom public path, please navigate in your browser to the point that you required`, ); diff --git a/test/cli/__snapshots__/basic.test.js.snap.webpack5 b/test/cli/__snapshots__/basic.test.js.snap.webpack5 index 26cbc12d00..e20c1a98dc 100644 --- a/test/cli/__snapshots__/basic.test.js.snap.webpack5 +++ b/test/cli/__snapshots__/basic.test.js.snap.webpack5 @@ -5,8 +5,7 @@ exports[`basic basic should accept the promise function of webpack.config.js: st Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`basic basic should respect output.publicPath config option in URL's output: stderr 1`] = ` @@ -16,14 +15,6 @@ exports[`basic basic should respect output.publicPath config option in URL's out [webpack-dev-server] Content not from webpack is served from '/public' directory" `; -exports[`basic basic should show info message when output.publicPath equals 'auto': stderr 1`] = ` -" [webpack-dev-server] Project is running at: - Loopback: http://localhost:/, http://:/, http://[]:/ - [webpack-dev-server] On Your Network (IPv4): http://:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" -`; - exports[`basic basic should show info message when output.publicPath is function: stderr 1`] = ` " [webpack-dev-server] Project is running at: Loopback: http://localhost:/, http://:/, http://[]:/ @@ -35,8 +26,7 @@ exports[`basic basic should show info message when output.publicPath is function exports[`basic basic should work using "--host localhost --port ": stderr 1`] = ` " [webpack-dev-server] Project is running at: Loopback: http://localhost:/, http://:/, http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`basic basic should work using multi compiler mode: stderr 1`] = ` @@ -44,8 +34,7 @@ exports[`basic basic should work using multi compiler mode: stderr 1`] = ` Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`basic basic should work: stderr 1`] = ` @@ -53,8 +42,7 @@ exports[`basic basic should work: stderr 1`] = ` Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`basic should output help should generate correct cli flags 1`] = ` diff --git a/test/cli/__snapshots__/bonjour-option.test.js.snap.webpack5 b/test/cli/__snapshots__/bonjour-option.test.js.snap.webpack5 index f319b348c6..6c449cde89 100644 --- a/test/cli/__snapshots__/bonjour-option.test.js.snap.webpack5 +++ b/test/cli/__snapshots__/bonjour-option.test.js.snap.webpack5 @@ -8,8 +8,7 @@ exports[`"bonjour" CLI option should work using "--bonjour and --server-type=htt [webpack-dev-server] On Your Network (IPv4): https://:/ [webpack-dev-server] On Your Network (IPv6): https://[]:/ [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] Broadcasting "https" with subtype of "webpack" via ZeroConf DNS (Bonjour) - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Broadcasting "https" with subtype of "webpack" via ZeroConf DNS (Bonjour)" `; exports[`"bonjour" CLI option should work using "--bonjour" 1`] = ` @@ -18,8 +17,7 @@ exports[`"bonjour" CLI option should work using "--bonjour" 1`] = ` [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] Broadcasting "http" with subtype of "webpack" via ZeroConf DNS (Bonjour) - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Broadcasting "http" with subtype of "webpack" via ZeroConf DNS (Bonjour)" `; exports[`"bonjour" CLI option should work using "--no-bonjour" 1`] = ` @@ -27,6 +25,5 @@ exports[`"bonjour" CLI option should work using "--no-bonjour" 1`] = ` Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; diff --git a/test/cli/__snapshots__/colors.test.js.snap.webpack5 b/test/cli/__snapshots__/colors.test.js.snap.webpack5 index 2539696cdf..fd01bfe554 100644 --- a/test/cli/__snapshots__/colors.test.js.snap.webpack5 +++ b/test/cli/__snapshots__/colors.test.js.snap.webpack5 @@ -5,8 +5,7 @@ exports[`colors should work and do not use colors using configuration with disab Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`colors should work do not use colors using "--no-color": stderr 1`] = ` @@ -14,8 +13,7 @@ exports[`colors should work do not use colors using "--no-color": stderr 1`] = ` Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`colors should work use colors by default: stderr 1`] = ` @@ -23,8 +21,7 @@ exports[`colors should work use colors by default: stderr 1`] = ` Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`colors should work use colors using "--color": stderr 1`] = ` @@ -32,8 +29,7 @@ exports[`colors should work use colors using "--color": stderr 1`] = ` Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`colors should work use colors using configuration with enabled colors: stderr 1`] = ` @@ -41,6 +37,5 @@ exports[`colors should work use colors using configuration with enabled colors: Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; diff --git a/test/cli/__snapshots__/historyApiFallback-option.test.js.snap.webpack5 b/test/cli/__snapshots__/historyApiFallback-option.test.js.snap.webpack5 index a7a3923181..bfb7b85086 100644 --- a/test/cli/__snapshots__/historyApiFallback-option.test.js.snap.webpack5 +++ b/test/cli/__snapshots__/historyApiFallback-option.test.js.snap.webpack5 @@ -6,8 +6,7 @@ exports[`"historyApiFallback" CLI option should work using "--history-api-fallba [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] 404s will fallback to '/index.html' - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] 404s will fallback to '/index.html'" `; exports[`"historyApiFallback" CLI option should work using "--no-history-api-fallback" 1`] = ` diff --git a/test/cli/__snapshots__/host-option.test.js.snap.webpack5 b/test/cli/__snapshots__/host-option.test.js.snap.webpack5 index 839ab516d5..54a5e6b310 100644 --- a/test/cli/__snapshots__/host-option.test.js.snap.webpack5 +++ b/test/cli/__snapshots__/host-option.test.js.snap.webpack5 @@ -5,29 +5,25 @@ exports[`"host" CLI option should work using "--host ::" (IPv6): stderr 1`] = ` Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`"host" CLI option should work using "--host ::1" (IPv6): stderr 1`] = ` " [webpack-dev-server] Project is running at: Loopback: http://localhost:/, http://:/, http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`"host" CLI option should work using "--host ::1" (IPv6): stderr 2`] = ` " [webpack-dev-server] Project is running at: Loopback: http://localhost:/, http://:/, http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`"host" CLI option should work using "--host ": stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] On Your Network (IPv4): http://:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`"host" CLI option should work using "--host 0.0.0.0" (IPv4): stderr 1`] = ` @@ -35,34 +31,29 @@ exports[`"host" CLI option should work using "--host 0.0.0.0" (IPv4): stderr 1`] Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`"host" CLI option should work using "--host 127.0.0.1" (IPv4): stderr 1`] = ` " [webpack-dev-server] Project is running at: Loopback: http://localhost:/, http://:/, http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`"host" CLI option should work using "--host local-ip": stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] On Your Network (IPv4): http://:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`"host" CLI option should work using "--host local-ipv4": stderr 1`] = ` " [webpack-dev-server] Project is running at: [webpack-dev-server] On Your Network (IPv4): http://:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`"host" CLI option should work using "--host localhost": stderr 1`] = ` " [webpack-dev-server] Project is running at: Loopback: http://localhost:/, http://:/, http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; diff --git a/test/cli/__snapshots__/ipc-option.test.js.snap.webpack5 b/test/cli/__snapshots__/ipc-option.test.js.snap.webpack5 index fef5939ec7..a74aa00abe 100644 --- a/test/cli/__snapshots__/ipc-option.test.js.snap.webpack5 +++ b/test/cli/__snapshots__/ipc-option.test.js.snap.webpack5 @@ -2,12 +2,10 @@ exports[`"ipc" CLI option should work using "--ipc": stderr 1`] = ` " [webpack-dev-server] Project is running at: "/webpack-dev-server.sock" - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`"ipc" CLI option should work using "--ipc=": stderr 1`] = ` " [webpack-dev-server] Project is running at: "/webpack-dev-server.cli.sock" - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; diff --git a/test/cli/__snapshots__/port-option.test.js.snap.webpack5 b/test/cli/__snapshots__/port-option.test.js.snap.webpack5 index adcf19a538..f4370b9118 100644 --- a/test/cli/__snapshots__/port-option.test.js.snap.webpack5 +++ b/test/cli/__snapshots__/port-option.test.js.snap.webpack5 @@ -5,8 +5,7 @@ exports[`"port" CLI option should work using "--port ": stderr 1`] = ` Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`"port" CLI option should work using "--port auto": stderr 1`] = ` @@ -14,6 +13,5 @@ exports[`"port" CLI option should work using "--port auto": stderr 1`] = ` Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; diff --git a/test/cli/__snapshots__/server-option.test.js.snap.webpack5 b/test/cli/__snapshots__/server-option.test.js.snap.webpack5 index afbebe9661..0a5aeb7f6e 100644 --- a/test/cli/__snapshots__/server-option.test.js.snap.webpack5 +++ b/test/cli/__snapshots__/server-option.test.js.snap.webpack5 @@ -1,14 +1,12 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`"server" CLI options should work using "--no-server-options-request-cert" 1`] = ` -" [webpack-dev-server] Generating SSL certificate... - [webpack-dev-server] SSL certificate: /node_modules/.cache/webpack-dev-server/server.pem +" [webpack-dev-server] SSL certificate: /node_modules/.cache/webpack-dev-server/server.pem [webpack-dev-server] Project is running at: Loopback: https://localhost:/, https://:/, https://[]:/ [webpack-dev-server] On Your Network (IPv4): https://:/ [webpack-dev-server] On Your Network (IPv6): https://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`"server" CLI options should work using "--server-options-key --server-options-pfx --server-options-passphrase webpack-dev-server --server-options-cert --server-options-ca " 1`] = ` @@ -16,8 +14,7 @@ exports[`"server" CLI options should work using "--server-options-key --s Loopback: https://localhost:/, https://:/, https://[]:/ [webpack-dev-server] On Your Network (IPv4): https://:/ [webpack-dev-server] On Your Network (IPv6): https://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`"server" CLI options should work using "--server-options-key --server-options-pfx --server-options-passphrase webpack-dev-server --server-options-cert " 1`] = ` @@ -25,8 +22,7 @@ exports[`"server" CLI options should work using "--server-options-key --s Loopback: https://localhost:/, https://:/, https://[]:/ [webpack-dev-server] On Your Network (IPv4): https://:/ [webpack-dev-server] On Your Network (IPv6): https://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`"server" CLI options should work using "--server-options-key --server-options-pfx --server-options-passphrase webpack-dev-server --server-options-cert " 2`] = ` @@ -34,8 +30,7 @@ exports[`"server" CLI options should work using "--server-options-key --s Loopback: https://localhost:/, https://:/, https://[]:/ [webpack-dev-server] On Your Network (IPv4): https://:/ [webpack-dev-server] On Your Network (IPv6): https://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`"server" CLI options should work using "--server-options-key-reset --server-options-key --server-options-pfx-reset --server-options-pfx --server-options-passphrase webpack-dev-server --server-options-cert-reset --server-options-cert --server-options-ca-reset --server-options-ca " 1`] = ` @@ -43,8 +38,7 @@ exports[`"server" CLI options should work using "--server-options-key-reset --se Loopback: https://localhost:/, https://:/, https://[]:/ [webpack-dev-server] On Your Network (IPv4): https://:/ [webpack-dev-server] On Your Network (IPv6): https://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`"server" CLI options should work using "--server-options-request-cert" 1`] = ` @@ -54,8 +48,7 @@ exports[`"server" CLI options should work using "--server-options-request-cert" Loopback: https://localhost:/, https://:/, https://[]:/ [webpack-dev-server] On Your Network (IPv4): https://:/ [webpack-dev-server] On Your Network (IPv6): https://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`"server" CLI options should work using "--server-type http" 1`] = ` @@ -63,8 +56,7 @@ exports[`"server" CLI options should work using "--server-type http" 1`] = ` Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`"server" CLI options should work using "--server-type https" 1`] = ` @@ -74,8 +66,7 @@ exports[`"server" CLI options should work using "--server-type https" 1`] = ` Loopback: https://localhost:/, https://:/, https://[]:/ [webpack-dev-server] On Your Network (IPv4): https://:/ [webpack-dev-server] On Your Network (IPv6): https://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`"server" CLI options should work using "--server-type spdy" 1`] = ` @@ -85,6 +76,5 @@ exports[`"server" CLI options should work using "--server-type spdy" 1`] = ` Loopback: https://localhost:/, https://:/, https://[]:/ [webpack-dev-server] On Your Network (IPv4): https://:/ [webpack-dev-server] On Your Network (IPv6): https://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; diff --git a/test/cli/__snapshots__/static-option.test.js.snap.webpack5 b/test/cli/__snapshots__/static-option.test.js.snap.webpack5 index 27529f0584..dbcfba7e20 100644 --- a/test/cli/__snapshots__/static-option.test.js.snap.webpack5 +++ b/test/cli/__snapshots__/static-option.test.js.snap.webpack5 @@ -5,8 +5,7 @@ exports[`"static" CLI option should work using "--no-static-serve-index": stderr Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`"static" CLI option should work using "--no-static-watch": stderr 1`] = ` @@ -14,8 +13,7 @@ exports[`"static" CLI option should work using "--no-static-watch": stderr 1`] = Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`"static" CLI option should work using "--static new-static --static other-static": stderr 1`] = ` @@ -23,8 +21,7 @@ exports[`"static" CLI option should work using "--static new-static --static oth Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from 'new-static, other-static' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from 'new-static, other-static' directory" `; exports[`"static" CLI option should work using "--static new-static": stderr 1`] = ` @@ -32,8 +29,7 @@ exports[`"static" CLI option should work using "--static new-static": stderr 1`] Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from 'new-static' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from 'new-static' directory" `; exports[`"static" CLI option should work using "--static": stderr 1`] = ` @@ -41,8 +37,7 @@ exports[`"static" CLI option should work using "--static": stderr 1`] = ` Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`"static" CLI option should work using "--static-directory static-dir": stderr 1`] = ` @@ -50,8 +45,7 @@ exports[`"static" CLI option should work using "--static-directory static-dir": Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from 'static-dir' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from 'static-dir' directory" `; exports[`"static" CLI option should work using "--static-public-path /public": stderr 1`] = ` @@ -59,8 +53,7 @@ exports[`"static" CLI option should work using "--static-public-path /public": s Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`"static" CLI option should work using "--static-public-path-reset": stderr 1`] = ` @@ -68,8 +61,7 @@ exports[`"static" CLI option should work using "--static-public-path-reset": std Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`"static" CLI option should work using "--static-reset --static-directory new-static-directory": stderr 1`] = ` @@ -77,8 +69,7 @@ exports[`"static" CLI option should work using "--static-reset --static-director Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from 'new-static-directory' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from 'new-static-directory' directory" `; exports[`"static" CLI option should work using "--static-reset": stderr 1`] = ` @@ -86,8 +77,7 @@ exports[`"static" CLI option should work using "--static-reset": stderr 1`] = ` Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from 'new-static-after-reset' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from 'new-static-after-reset' directory" `; exports[`"static" CLI option should work using "--static-serve-index": stderr 1`] = ` @@ -95,8 +85,7 @@ exports[`"static" CLI option should work using "--static-serve-index": stderr 1` Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`"static" CLI option should work using "--static-watch": stderr 1`] = ` @@ -104,6 +93,5 @@ exports[`"static" CLI option should work using "--static-watch": stderr 1`] = ` Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; diff --git a/test/cli/__snapshots__/watchFiles-option.test.js.snap.webpack5 b/test/cli/__snapshots__/watchFiles-option.test.js.snap.webpack5 index 0b04a59828..e01922ddab 100644 --- a/test/cli/__snapshots__/watchFiles-option.test.js.snap.webpack5 +++ b/test/cli/__snapshots__/watchFiles-option.test.js.snap.webpack5 @@ -5,8 +5,7 @@ exports[`"watchFiles" CLI option should work using "--watch-files --watc Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`"watchFiles" CLI option should work using "--watch-files ": stderr 1`] = ` @@ -14,8 +13,7 @@ exports[`"watchFiles" CLI option should work using "--watch-files ": stde Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; exports[`"watchFiles" CLI option should work using "--watch-files-reset --watch-files ": stderr 1`] = ` @@ -23,6 +21,5 @@ exports[`"watchFiles" CLI option should work using "--watch-files-reset --watch- Loopback: http://localhost:/, http://:/, http://[]:/ [webpack-dev-server] On Your Network (IPv4): http://:/ [webpack-dev-server] On Your Network (IPv6): http://[]:/ - [webpack-dev-server] Content not from webpack is served from '/public' directory - [webpack-dev-server] You probably have a custom public path, please navigate in your browser to the point that you required" + [webpack-dev-server] Content not from webpack is served from '/public' directory" `; diff --git a/test/cli/basic.test.js b/test/cli/basic.test.js index 5632203c41..15d51a1ad5 100644 --- a/test/cli/basic.test.js +++ b/test/cli/basic.test.js @@ -72,21 +72,6 @@ describe("basic", () => { expect(normalizeStderr(stderr)).toMatchSnapshot("stderr"); }); - it("should show info message when output.publicPath equals 'auto'", async () => { - const { exitCode, stderr } = await testBin([ - "--config", - path.resolve( - __dirname, - "../fixtures/cli-output-public-path-auto-config/webpack.config.js", - ), - "--port", - port, - ]); - - expect(exitCode).toEqual(0); - expect(normalizeStderr(stderr)).toMatchSnapshot("stderr"); - }); - it("should show info message when output.publicPath is function", async () => { const { exitCode, stderr } = await testBin([ "--config", diff --git a/test/fixtures/cli-output-public-path-auto-config/foo.js b/test/fixtures/cli-output-public-path-auto-config/foo.js deleted file mode 100644 index 5940e9197c..0000000000 --- a/test/fixtures/cli-output-public-path-auto-config/foo.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; - -console.log("i am foo!"); diff --git a/test/fixtures/cli-output-public-path-auto-config/webpack.config.js b/test/fixtures/cli-output-public-path-auto-config/webpack.config.js deleted file mode 100644 index 091d2255ad..0000000000 --- a/test/fixtures/cli-output-public-path-auto-config/webpack.config.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -const { join } = require("path"); - -module.exports = { - mode: "development", - entry: join(__dirname, "foo.js"), - output: { - publicPath: "auto", - }, -};