@@ -254,9 +254,8 @@ module.exports = async (program: any) => {
254254 } )
255255
256256 const isUnspecifiedHost = host === `0.0.0.0` || host === `::`
257- let prettyHost , lanUrlForConfig , lanUrlForTerminal
257+ let lanUrlForConfig , lanUrlForTerminal
258258 if ( isUnspecifiedHost ) {
259- prettyHost = `localhost`
260259 try {
261260 // This can only return an IPv4 address
262261 lanUrlForConfig = address . ip ( )
@@ -278,14 +277,12 @@ module.exports = async (program: any) => {
278277 } catch ( _e ) {
279278 // ignored
280279 }
281- } else {
282- prettyHost = host
283280 }
284281 // TODO collect errors (GraphQL + Webpack) in Redux so we
285282 // can clear terminal and print them out on every compile.
286283 // Borrow pretty printing code from webpack plugin.
287- const localUrlForTerminal = prettyPrintUrl ( prettyHost )
288- const localUrlForBrowser = formatUrl ( prettyHost )
284+ const localUrlForTerminal = prettyPrintUrl ( host )
285+ const localUrlForBrowser = formatUrl ( host )
289286 return {
290287 lanUrlForConfig,
291288 lanUrlForTerminal,
@@ -318,11 +315,6 @@ module.exports = async (program: any) => {
318315 console . log ( )
319316 }
320317
321- const host =
322- listener . address ( ) . address === `127.0.0.1`
323- ? `localhost`
324- : listener . address ( ) . address
325-
326318 let isFirstCompile = true
327319 // "done" event fires when Webpack has finished recompiling the bundle.
328320 // Whether or not you have warnings or errors, you will get this event.
@@ -331,7 +323,7 @@ module.exports = async (program: any) => {
331323 // options so we are going to "massage" the warnings and errors and present
332324 // them in a readable focused way.
333325 const messages = formatWebpackMessages ( stats . toJson ( { } , true ) )
334- const urls = prepareUrls ( `http` , host , port )
326+ const urls = prepareUrls ( `http` , program . host , program . port )
335327 const isSuccessful = ! messages . errors . length && ! messages . warnings . length
336328 // if (isSuccessful) {
337329 // console.log(chalk.green(`Compiled successfully!`))
0 commit comments