Skip to content

Commit

Permalink
fix viewer endpoint route url (#642)
Browse files Browse the repository at this point in the history
* fix viewer endpoint route url

* fix viewer endpoint route url
ufo

* code style

* chore: might be optional

---------

Co-authored-by: Mariusz Kuś <mariusz.kus@meble.pl>
Co-authored-by: Sébastien Chopin <seb@nuxt.com>
  • Loading branch information
3 people committed Mar 21, 2023
1 parent b89aa05 commit d4d66f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,10 @@ export default defineNuxtModule<ModuleOptions>({
// Add _tailwind config viewer endpoint
// TODO: Fix `addServerHandler` on Nuxt 2 w/o Bridge
if (nuxt.options.dev && moduleOptions.viewer) {
const route = '/_tailwind'
const { withTrailingSlash, withoutTrailingSlash, joinURL } = await import('ufo')
const route = joinURL(nuxt.options.app?.baseURL, '/_tailwind')
// @ts-ignore
const createServer = await import('tailwind-config-viewer/server/index.js').then(r => r.default || r) as any
const { withTrailingSlash, withoutTrailingSlash } = await import('ufo')
const routerPrefix = isNuxt3() ? route : undefined
const _viewerDevMiddleware = createServer({ tailwindConfigProvider: () => tailwindConfig, routerPrefix }).asMiddleware()
const viewerDevMiddleware = eventHandler((event) => {
Expand Down

0 comments on commit d4d66f3

Please sign in to comment.