mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-24 06:35:10 +00:00
fix: normalise index before slugifying
This commit is contained in:
parent
75990c5dbc
commit
7db327cf9b
@ -6,7 +6,7 @@ export function getNameFromPath (path: string, relativeTo?: string) {
|
||||
const relativePath = relativeTo
|
||||
? normalize(path).replace(withTrailingSlash(normalize(relativeTo)), '')
|
||||
: basename(path)
|
||||
return kebabCase(relativePath.replace(/[\\/]+/g, '-').replace(/\/index\.\w+$/, '').replace(extname(relativePath), '')).replace(/["']/g, '')
|
||||
return kebabCase(relativePath.replace(/\/index\.\w+$/, '').replace(/[\\/]+/g, '-').replace(extname(relativePath), '')).replace(/["']/g, '')
|
||||
}
|
||||
|
||||
export function hasSuffix (path: string, suffix: string) {
|
||||
|
Loading…
Reference in New Issue
Block a user