Skip to content

Commit

Permalink
fix: CSS path in expose-production produce double slashes
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
PierreRainero authored and ruleeeer committed Jan 16, 2025
1 parent 7baff37 commit 8df65ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/lib/src/prod/expose-production.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 8df65ef

Please sign in to comment.