Skip to content

Commit

Permalink
chore: hide viewer url logging if devtools enabled, closes #798
Browse files Browse the repository at this point in the history
  • Loading branch information
ineshbose committed Dec 25, 2024
1 parent 19fc7dd commit 78517a0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ export const setupViewer = async (twConfig: string | Partial<TWConfig>, config:
})
})

nuxt.hook('listen', (_, listener) => {
const shouldLogUrl = 'devtools' in nuxt.options ? !nuxt.options.devtools.enabled : true

// eslint-disable-next-line @typescript-eslint/no-unused-expressions
shouldLogUrl && nuxt.hook('listen', (_, listener) => {
const viewerUrl = cleanDoubleSlashes(joinURL(listener.url, config.endpoint))
logger.info(`Tailwind Viewer: ${colors.underline(colors.yellow(withTrailingSlash(viewerUrl)))}`)
})
Expand Down

0 comments on commit 78517a0

Please sign in to comment.