From 8df65ef4d31dc7f18027ed8d9101f3a7f2bfefb2 Mon Sep 17 00:00:00 2001 From: Pierre Rainero Date: Tue, 14 Jan 2025 15:39:27 +0100 Subject: [PATCH] fix: CSS path in expose-production produce double slashes Since version 1.3.7 using a vite.base ending with a slash produce a double slashes on production due to `join('/')` without extra checks (what is not desired). --- packages/lib/src/prod/expose-production.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/lib/src/prod/expose-production.ts b/packages/lib/src/prod/expose-production.ts index ad448c68..02071729 100644 --- a/packages/lib/src/prod/expose-production.ts +++ b/packages/lib/src/prod/expose-production.ts @@ -94,7 +94,7 @@ export function prodExposePlugin( let href = '' const baseUrl = base || curUrl if (baseUrl && baseUrl !== '/') { - href = [baseUrl, assetsDir, cssPath].filter(Boolean).join('/') + href = [baseUrl, assetsDir, cssPath].filter(Boolean).map(part => part.endsWith('/') ? part.substring(0, part.length - 1) : part).join('/') } else { href = curUrl + cssPath }