mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(utils): flatRoutes regex for nested routes with trailing slash enabled (#6791)
This commit is contained in:
parent
e999060da5
commit
ae769ce763
@ -15,7 +15,7 @@ export const flatRoutes = function flatRoutes (router, fileName = '', routes = [
|
||||
}
|
||||
return flatRoutes(r.children, fileName + r.path + '/', routes)
|
||||
}
|
||||
fileName = fileName.replace(/^\/+$/, '/')
|
||||
fileName = fileName.replace(/\/+/g, '/')
|
||||
routes.push(
|
||||
(r.path === '' && fileName[fileName.length - 1] === '/'
|
||||
? fileName.slice(0, -1)
|
||||
|
Loading…
Reference in New Issue
Block a user