mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Add much better logic to normalize routes.
This commit is contained in:
parent
b5bd0daf62
commit
c077ebe7ba
|
@ -17,7 +17,8 @@ export default class PageLoader {
|
|||
throw new Error('Route name should start with a "/"')
|
||||
}
|
||||
|
||||
return route.replace(/index$/, '')
|
||||
if (route === '/') return route
|
||||
return route.replace(/(\/)?(index)?$/, '')
|
||||
}
|
||||
|
||||
loadPage (route) {
|
||||
|
|
Loading…
Reference in a new issue