Skip to content

Commit 0ceabc6

Browse files
committed
Refactor CLI output on startup
It should be clearer now what actually happens when starting WDS. Also, the URL it's running at will now not start with a space. Ref #681
1 parent 220ded6 commit 0ceabc6

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

bin/webpack-dev-server.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -354,17 +354,16 @@ function processOptions(wpOpt) {
354354
}
355355

356356
function reportReadiness(uri, options) {
357+
var startSentence = "Project is running at " + uri;
357358
if(options.socket) {
358-
console.log("Listening to socket", options.socket);
359-
} else {
360-
console.log(" " + uri);
359+
startSentence = "Listening to socket at " + options.socket;
361360
}
361+
console.log((argv["progress"] ? "\n" : "") + startSentence);
362362

363-
console.log("webpack result is served from " + options.publicPath);
364-
if(Array.isArray(options.contentBase))
365-
console.log("content is served from " + options.contentBase.join(", "));
366-
else if(options.contentBase)
367-
console.log("content is served from " + options.contentBase);
363+
console.log("webpack output is served from " + options.publicPath);
364+
var contentBase = Array.isArray(options.contentBase) ? options.contentBase.join(", ") : options.contentBase;
365+
if(contentBase)
366+
console.log("Content not from webpack is served from " + contentBase);
368367
if(options.historyApiFallback)
369368
console.log("404s will fallback to %s", options.historyApiFallback.index || "/index.html");
370369
if(options.open)

0 commit comments

Comments
 (0)