From 245a3d6145dd862b930376154d72b653d4c48cc6 Mon Sep 17 00:00:00 2001 From: richardevcom Date: Tue, 30 Jul 2024 02:45:58 +0300 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=90=9B=20module.ts:=20Updated=20Tab?= =?UTF-8?q?=20view=20src?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed issue #883: Cannot find any path matching /_tailwind/, when using baseUrl: '/dev/'. Cannot find any path matching '/_tailwind/' --- src/module.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/module.ts b/src/module.ts index fd8ff472..3f86297a 100644 --- a/src/module.ts +++ b/src/module.ts @@ -142,7 +142,7 @@ export default defineNuxtModule({ category: 'modules', view: { type: 'iframe', - src: withTrailingSlash(viewerConfig.endpoint), + src: withTrailingSlash(nuxt.options.app?.baseURL + viewerConfig.endpoint), }, }) }) From 0f1193b594fa3b7dd3c273f73eafdd95bcd50e85 Mon Sep 17 00:00:00 2001 From: richardev <17192512+richardevcom@users.noreply.github.com> Date: Tue, 30 Jul 2024 20:08:34 +0300 Subject: [PATCH 2/3] fix: parse app.baseURL slashes for Tab view src baseURL I made a mistak in previous commit forcing default '/' baseURL in front of already existing trailing slash before default `/_tailwind/`. This fix makes sure if baseURL is `/` it removes it and if it has something similar to `/dev/` it with return `/dev`, making final url `/dev/_tailwind/`. --- src/module.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/module.ts b/src/module.ts index 3f86297a..94722cf7 100644 --- a/src/module.ts +++ b/src/module.ts @@ -1,5 +1,5 @@ import { join } from 'pathe' -import { withTrailingSlash } from 'ufo' +import { withoutTrailingSlash, withTrailingSlash } from 'ufo' import { defineNuxtModule, installModule, @@ -142,7 +142,7 @@ export default defineNuxtModule({ category: 'modules', view: { type: 'iframe', - src: withTrailingSlash(nuxt.options.app?.baseURL + viewerConfig.endpoint), + src: withTrailingSlash((nuxt.options.app?.baseURL === '/' ? '' : withoutTrailingSlash(nuxt.options.app.baseURL)) + viewerConfig.endpoint) }, }) }) From 6feef565880a0fcf3970f030f3aa12a5a550bfc7 Mon Sep 17 00:00:00 2001 From: Inesh Bose Date: Thu, 1 Aug 2024 18:02:16 +0100 Subject: [PATCH 3/3] chore: use joinURL --- src/module.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/module.ts b/src/module.ts index 94722cf7..a6d9bcfb 100644 --- a/src/module.ts +++ b/src/module.ts @@ -1,5 +1,5 @@ import { join } from 'pathe' -import { withoutTrailingSlash, withTrailingSlash } from 'ufo' +import { joinURL } from 'ufo' import { defineNuxtModule, installModule, @@ -142,7 +142,7 @@ export default defineNuxtModule({ category: 'modules', view: { type: 'iframe', - src: withTrailingSlash((nuxt.options.app?.baseURL === '/' ? '' : withoutTrailingSlash(nuxt.options.app.baseURL)) + viewerConfig.endpoint) + src: joinURL(nuxt.options.app?.baseURL, viewerConfig.endpoint), }, }) })