@@ -7,7 +7,7 @@ import { join } from 'node:path'
7
7
import process from 'node:process'
8
8
import { promisify } from 'node:util'
9
9
import { checkExistingCertificates , checkHosts , cleanup , startProxies } from '@stacksjs/rpx'
10
- import colors , { dim } from 'picocolors'
10
+ import { bold , cyan , dim , green } from 'picocolors'
11
11
import packageJson from '../package.json'
12
12
import { buildConfig } from './utils'
13
13
@@ -210,34 +210,34 @@ export function VitePluginLocal(options: VitePluginLocalOptions): Plugin {
210
210
const localUrl = `http://localhost:${ port } /`
211
211
const proxiedUrl = `${ protocol } ://${ proxyUrl } /`
212
212
const colorUrl = ( url : string ) =>
213
- colors . cyan ( url . replace ( / : ( \d + ) \/ / , ( _ , port ) => `:${ colors . bold ( port ) } /` ) )
213
+ cyan ( url . replace ( / : ( \d + ) \/ / , ( _ , port ) => `:${ bold ( port ) } /` ) )
214
214
215
215
const versions = getPackageVersions ( )
216
216
if ( versions . vitepress ) {
217
217
console . log (
218
- `\n ${ colors . bold ( colors . green ( 'vitepress' ) ) } ${ colors . green ( `v${ versions . vitepress } ` ) } via ${ colors . bold ( colors . green ( 'vite-plugin-local' ) ) } ${ colors . green ( `v${ versions [ 'vite-plugin-local' ] } ` ) } \n` ,
218
+ `\n ${ bold ( green ( 'vitepress' ) ) } ${ green ( `v${ versions . vitepress } ` ) } ${ dim ( ' via' ) } ${ bold ( green ( 'vite-plugin-local' ) ) } ${ green ( `v${ versions [ 'vite-plugin-local' ] } ` ) } \n` ,
219
219
)
220
220
}
221
221
else {
222
222
console . log (
223
- `\n ${ colors . bold ( colors . green ( 'vite' ) ) } ${ colors . green ( `v${ versions . vite } ` ) } via ${ colors . bold ( colors . green ( 'vite-plugin-local' ) ) } ${ colors . green ( `v${ versions [ 'vite-plugin-local' ] } ` ) } \n` ,
223
+ `\n ${ bold ( green ( 'vite' ) ) } ${ green ( `v${ versions . vite } ` ) } ${ dim ( ' via' ) } ${ bold ( green ( 'vite-plugin-local' ) ) } ${ green ( `v${ versions [ 'vite-plugin-local' ] } ` ) } \n` ,
224
224
)
225
225
}
226
226
227
- console . log ( ` ${ colors . green ( '➜' ) } ${ colors . bold ( 'Local' ) } : ${ colorUrl ( localUrl ) } ` )
228
- console . log ( ` ${ colors . green ( '➜' ) } ${ colors . bold ( 'Proxied' ) } : ${ colorUrl ( proxiedUrl ) } ` )
227
+ console . log ( ` ${ green ( '➜' ) } ${ bold ( 'Local' ) } : ${ colorUrl ( localUrl ) } ` )
228
+ console . log ( ` ${ green ( '➜' ) } ${ bold ( 'Proxied' ) } : ${ colorUrl ( proxiedUrl ) } ` )
229
229
230
230
if ( options . https ) {
231
- console . log ( ` ${ colors . green ( '➜' ) } ${ colors . bold ( 'SSL' ) } : ${ colors . dim ( 'TLS 1.2/1.3, HTTP/2' ) } ` )
231
+ console . log ( ` ${ green ( '➜' ) } ${ bold ( 'SSL' ) } : ${ dim ( 'TLS 1.2/1.3, HTTP/2' ) } ` )
232
232
}
233
233
234
234
console . log (
235
- colors . dim ( ` ${ colors . green ( '➜' ) } ${ colors . bold ( 'Network' ) } : use ` )
236
- + colors . bold ( '--host' )
237
- + colors . dim ( ' to expose' ) ,
235
+ dim ( ` ${ green ( '➜' ) } ${ bold ( 'Network' ) } : use ` )
236
+ + bold ( '--host' )
237
+ + dim ( ' to expose' ) ,
238
238
)
239
239
240
- console . log ( `\n ${ colors . green ( '➜' ) } ${ dim ( 'press' ) } ${ colors . bold ( 'h' ) } ${ dim ( 'to show help' ) } \n` )
240
+ console . log ( `\n ${ green ( dim ( '➜' ) ) } ${ dim ( 'press' ) } ${ bold ( 'h' ) } ${ dim ( 'to show help' ) } \n` )
241
241
}
242
242
243
243
server . printUrls ( )
0 commit comments