@@ -398,8 +398,12 @@ module.exports = async (program: any) => {
398
398
} )
399
399
400
400
const isUnspecifiedHost = host === `0.0.0.0` || host === `::`
401
- let lanUrlForConfig , lanUrlForTerminal
401
+ let prettyHost = host ,
402
+ lanUrlForConfig ,
403
+ lanUrlForTerminal
402
404
if ( isUnspecifiedHost ) {
405
+ prettyHost = `localhost`
406
+
403
407
try {
404
408
// This can only return an IPv4 address
405
409
lanUrlForConfig = address . ip ( )
@@ -425,8 +429,8 @@ module.exports = async (program: any) => {
425
429
// TODO collect errors (GraphQL + Webpack) in Redux so we
426
430
// can clear terminal and print them out on every compile.
427
431
// Borrow pretty printing code from webpack plugin.
428
- const localUrlForTerminal = prettyPrintUrl ( host )
429
- const localUrlForBrowser = formatUrl ( host )
432
+ const localUrlForTerminal = prettyPrintUrl ( prettyHost )
433
+ const localUrlForBrowser = formatUrl ( prettyHost )
430
434
return {
431
435
lanUrlForConfig,
432
436
lanUrlForTerminal,
@@ -532,7 +536,6 @@ module.exports = async (program: any) => {
532
536
}
533
537
} )
534
538
}
535
-
536
539
let isFirstCompile = true
537
540
// "done" event fires when Webpack has finished recompiling the bundle.
538
541
// Whether or not you have warnings or errors, you will get this event.
@@ -547,10 +550,6 @@ module.exports = async (program: any) => {
547
550
program . port
548
551
)
549
552
const isSuccessful = ! messages . errors . length
550
- // if (isSuccessful) {
551
- // console.log(chalk.green(`Compiled successfully!`))
552
- // }
553
- // if (isSuccessful && (isInteractive || isFirstCompile)) {
554
553
if ( isSuccessful && isFirstCompile ) {
555
554
printInstructions ( program . sitePackageJson . name , urls , program . useYarn )
556
555
printDeprecationWarnings ( )
@@ -567,36 +566,6 @@ module.exports = async (program: any) => {
567
566
568
567
isFirstCompile = false
569
568
570
- // If errors exist, only show errors.
571
- // if (messages.errors.length) {
572
- // // Only keep the first error. Others are often indicative
573
- // // of the same problem, but confuse the reader with noise.
574
- // if (messages.errors.length > 1) {
575
- // messages.errors.length = 1
576
- // }
577
- // console.log(chalk.red("Failed to compile.\n"))
578
- // console.log(messages.errors.join("\n\n"))
579
- // return
580
- // }
581
-
582
- // Show warnings if no errors were found.
583
- // if (messages.warnings.length) {
584
- // console.log(chalk.yellow("Compiled with warnings.\n"))
585
- // console.log(messages.warnings.join("\n\n"))
586
-
587
- // // Teach some ESLint tricks.
588
- // console.log(
589
- // "\nSearch for the " +
590
- // chalk.underline(chalk.yellow("keywords")) +
591
- // " to learn more about each warning."
592
- // )
593
- // console.log(
594
- // "To ignore, add " +
595
- // chalk.cyan("// eslint-disable-next-line") +
596
- // " to the line before.\n"
597
- // )
598
- // }
599
-
600
569
done ( )
601
570
} )
602
571
}
0 commit comments