@@ -173,6 +173,7 @@ function printServerUrls(
173
173
info : Logger [ 'info' ]
174
174
) : void {
175
175
const urls : Array < { label : string ; url : string } > = [ ]
176
+ const notes : Array < { label : string ; message : string } > = [ ]
176
177
177
178
if ( hostname . host && loopbackHosts . has ( hostname . host ) ) {
178
179
let hostnameName = hostname . name
@@ -191,9 +192,11 @@ function printServerUrls(
191
192
} )
192
193
193
194
if ( hostname . name === 'localhost' ) {
194
- urls . push ( {
195
- label : 'Network' ,
196
- url : colors . dim ( `use ${ colors . white ( colors . bold ( '--host' ) ) } to expose` )
195
+ notes . push ( {
196
+ label : 'Hint' ,
197
+ message : colors . dim (
198
+ `Use ${ colors . white ( colors . bold ( '--host' ) ) } to expose to network.`
199
+ )
197
200
} )
198
201
}
199
202
} else {
@@ -217,9 +220,17 @@ function printServerUrls(
217
220
} )
218
221
}
219
222
220
- const length = urls . reduce (
221
- ( length , { label } ) => Math . max ( length , label . length ) ,
222
- 0
223
+ if ( ! hostname . host || wildcardHosts . has ( hostname . host ) ) {
224
+ notes . push ( {
225
+ label : 'Note' ,
226
+ message : colors . dim (
227
+ 'You are using a wildcard host. Ports might be overriden.'
228
+ )
229
+ } )
230
+ }
231
+
232
+ const length = Math . max (
233
+ ...[ ...urls , ...notes ] . map ( ( { label } ) => label . length )
223
234
)
224
235
const print = (
225
236
iconWithColor : string ,
@@ -236,11 +247,7 @@ function printServerUrls(
236
247
urls . forEach ( ( { label, url : text } ) => {
237
248
print ( colors . green ( '➜' ) , label , text )
238
249
} )
239
- if ( ! hostname . host || wildcardHosts . has ( hostname . host ) ) {
240
- print (
241
- colors . bold ( colors . blue ( 'ⓘ' ) ) ,
242
- 'Note' ,
243
- colors . dim ( 'You are using a wildcard host. Ports might be overriden.' )
244
- )
245
- }
250
+ notes . forEach ( ( { label, message : text } ) => {
251
+ print ( colors . white ( '❖' ) , label , text )
252
+ } )
246
253
}
0 commit comments