Skip to content

Commit

Permalink
fix: tailwind viewer url (#453)
Browse files Browse the repository at this point in the history
Co-authored-by: Sébastien Chopin <seb@nuxtjs.com>
  • Loading branch information
shba007 and atinux committed Apr 20, 2022
1 parent 56033ce commit d35b39c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion playground/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineNuxtConfig } from 'nuxt3'
import tailwindModule from '..'
import tailwindModule from '../src/module'

export default defineNuxtConfig({
// vite: false,
Expand Down
5 changes: 4 additions & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ export default defineNuxtModule({
_viewerDevMiddleware(req, res)
}
addServerMiddleware({ path, handler: viewerDevMiddleware })
nuxt.hook('listen', () => { logger.info(`Tailwind Viewer: ${chalk.underline.yellow(path)}`) })
nuxt.hook('listen', (_, listener) => {
const fullPath = `${withoutTrailingSlash(listener.url)}${path}`;
logger.info(`Tailwind Viewer: ${chalk.underline.yellow(fullPath)}`);
});
}
}
})

0 comments on commit d35b39c

Please sign in to comment.