Skip to content

Commit 628f0a2

Browse files
stephenlacyshellscape
authored andcommitted
Fully mute output info if quiet is set to true. (#999)
This fully mutes all startup messages if quiet is set.
1 parent 8207238 commit 628f0a2

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

bin/webpack-dev-server.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,8 @@ function startDevServer(wpOpt, options) {
443443

444444
function reportReadiness(uri, options) {
445445
const useColor = argv.color;
446+
const contentBase = Array.isArray(options.contentBase) ? options.contentBase.join(", ") : options.contentBase;
447+
446448
if(!options.quiet) {
447449
let startSentence = `Project is running at ${colorInfo(useColor, uri)}`
448450
if(options.socket) {
@@ -451,19 +453,21 @@ function reportReadiness(uri, options) {
451453
console.log((argv["progress"] ? "\n" : "") + startSentence);
452454

453455
console.log(`webpack output is served from ${colorInfo(useColor, options.publicPath)}`);
456+
457+
if(contentBase)
458+
console.log(`Content not from webpack is served from ${colorInfo(useColor, contentBase)}`);
459+
460+
if(options.historyApiFallback)
461+
console.log(`404s will fallback to ${colorInfo(useColor, options.historyApiFallback.index || "/index.html")}`);
462+
463+
if(options.bonjour)
464+
console.log("Broadcasting \"http\" with subtype of \"webpack\" via ZeroConf DNS (Bonjour)");
454465
}
455-
const contentBase = Array.isArray(options.contentBase) ? options.contentBase.join(", ") : options.contentBase;
456-
if(contentBase)
457-
console.log(`Content not from webpack is served from ${colorInfo(useColor, contentBase)}`);
458-
if(options.historyApiFallback)
459-
console.log(`404s will fallback to ${colorInfo(useColor, options.historyApiFallback.index || "/index.html")}`);
460466
if(options.open) {
461467
open(uri + options.openPage).catch(function() {
462468
console.log("Unable to open browser. If you are running in a headless environment, please do not use the open flag.");
463469
});
464470
}
465-
if(options.bonjour)
466-
console.log("Broadcasting \"http\" with subtype of \"webpack\" via ZeroConf DNS (Bonjour)");
467471
}
468472

469473
function broadcastZeroconf(options) {

0 commit comments

Comments
 (0)