Skip to content

Commit d00a61d

Browse files
committed
fix(inspector): no longer hijack printUrls
1 parent 05cc652 commit d00a61d

File tree

1 file changed

+0
-22
lines changed
  • packages-integrations/inspector/src

1 file changed

+0
-22
lines changed

packages-integrations/inspector/src/index.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { dirname, resolve } from 'node:path'
66
import { fileURLToPath } from 'node:url'
77
import { SKIP_COMMENT_RE } from '#integration/constants'
88
import { BetterMap, CountableSet } from '@unocss/core'
9-
import { bold, cyan, green } from 'colorette'
109
import gzipSize from 'gzip-size'
1110
import sirv from 'sirv'
1211
import { analyzer } from './analyzer'
@@ -110,27 +109,6 @@ export default function UnocssInspector(ctx: UnocssPluginContext): Plugin {
110109

111110
next()
112111
})
113-
114-
const _printUrls = server.printUrls
115-
const colorUrl = (url: string) =>
116-
cyan(url.replace(/:(\d+)\//, (_, port) => `:${bold(port)}/`))
117-
118-
server.printUrls = () => {
119-
_printUrls()
120-
for (const localUrl of server.resolvedUrls?.local ?? []) {
121-
// server.config.base will be normalized with leading and trailing slashes,
122-
// but localUrl might not have a trailing slash
123-
const appUrl = localUrl.endsWith('/') ? localUrl : `${localUrl}/`
124-
// remove the base path from appUrl if possible
125-
const serverUrl = server.config.base && appUrl.endsWith(server.config.base)
126-
? appUrl.slice(0, -server.config.base.length)
127-
: appUrl.slice(0, -1) // remove the trailing slash
128-
// we removed the trailing slash from serverUrl when removing the base, add it back
129-
const inspectorUrl = `${serverUrl}/${baseUrl}/`
130-
// eslint-disable-next-line no-console
131-
console.log(` ${green('➜')} ${bold('UnoCSS Inspector')}: ${colorUrl(`${inspectorUrl}`)}`)
132-
}
133-
}
134112
}
135113

136114
return {

0 commit comments

Comments
 (0)