Skip to content

Commit 4e9195c

Browse files
committed
chore: use named imports
1 parent e2bc590 commit 4e9195c

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/index.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { join } from 'node:path'
77
import process from 'node:process'
88
import { promisify } from 'node:util'
99
import { checkExistingCertificates, checkHosts, cleanup, startProxies } from '@stacksjs/rpx'
10-
import colors, { dim } from 'picocolors'
10+
import { bold, cyan, dim, green } from 'picocolors'
1111
import packageJson from '../package.json'
1212
import { buildConfig } from './utils'
1313

@@ -210,34 +210,34 @@ export function VitePluginLocal(options: VitePluginLocalOptions): Plugin {
210210
const localUrl = `http://localhost:${port}/`
211211
const proxiedUrl = `${protocol}://${proxyUrl}/`
212212
const colorUrl = (url: string) =>
213-
colors.cyan(url.replace(/:(\d+)\//, (_, port) => `:${colors.bold(port)}/`))
213+
cyan(url.replace(/:(\d+)\//, (_, port) => `:${bold(port)}/`))
214214

215215
const versions = getPackageVersions()
216216
if (versions.vitepress) {
217217
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`,
219219
)
220220
}
221221
else {
222222
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`,
224224
)
225225
}
226226

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)}`)
229229

230230
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')}`)
232232
}
233233

234234
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'),
238238
)
239239

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`)
241241
}
242242

243243
server.printUrls()

0 commit comments

Comments
 (0)