Skip to content

Commit 1892bed

Browse files
committed
fix: ensure absolute base path ends with '/'
1 parent 3b5ac6a commit 1892bed

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/utils.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ export function slash(str: string) {
33
}
44

55
export function resolveBasePath(base: string) {
6-
if (isAbsolute(base))
7-
return base
8-
96
let basePath = base
7+
108
if (!basePath.endsWith('/'))
119
basePath = `${basePath}/`
1210

11+
if (isAbsolute(basePath))
12+
return basePath
13+
1314
if (!basePath.startsWith('/') && !basePath.startsWith('./'))
1415
basePath = `/${basePath}`
1516

0 commit comments

Comments
 (0)