@@ -22,6 +22,13 @@ function versionInfo() {
22
22
"webpack " + require ( "webpack/package.json" ) . version ;
23
23
}
24
24
25
+ function colorize ( useColor , msg ) {
26
+ if ( useColor )
27
+ // Make text blue and bold, so it *pops*
28
+ return "\u001b[1m\u001b[34m" + msg + "\u001b[39m\u001b[22m" ;
29
+ return msg ;
30
+ }
31
+
25
32
var yargs = require ( "yargs" )
26
33
. usage ( versionInfo ( ) +
27
34
"\nUsage: http://webpack.github.io/docs/webpack-dev-server.html" ) ;
@@ -375,18 +382,19 @@ function processOptions(wpOpt) {
375
382
}
376
383
377
384
function reportReadiness ( uri , options ) {
378
- var startSentence = "Project is running at " + uri ;
385
+ var useColor = options . stats . colors ;
386
+ var startSentence = "Project is running at " + colorize ( useColor , uri )
379
387
if ( options . socket ) {
380
- startSentence = "Listening to socket at " + options . socket ;
388
+ startSentence = "Listening to socket at " + colorize ( useColor , options . socket ) ;
381
389
}
382
390
console . log ( ( argv [ "progress" ] ? "\n" : "" ) + startSentence ) ;
383
391
384
- console . log ( "webpack output is served from " + options . publicPath ) ;
392
+ console . log ( "webpack output is served from " + colorize ( useColor , options . publicPath ) ) ;
385
393
var contentBase = Array . isArray ( options . contentBase ) ? options . contentBase . join ( ", " ) : options . contentBase ;
386
394
if ( contentBase )
387
- console . log ( "Content not from webpack is served from " + contentBase ) ;
395
+ console . log ( "Content not from webpack is served from " + colorize ( useColor , contentBase ) ) ;
388
396
if ( options . historyApiFallback )
389
- console . log ( "404s will fallback to %s" , options . historyApiFallback . index || "/index.html" ) ;
397
+ console . log ( "404s will fallback to " + colorize ( useColor , options . historyApiFallback . index || "/index.html" ) ) ;
390
398
if ( options . open )
391
399
open ( uri ) ;
392
400
}
0 commit comments