Skip to content

Commit

Permalink
fix: Fix TypeError: Cannot read property 'pages' of undefined in `e…
Browse files Browse the repository at this point in the history
…xtendRoutes`

Fixes #113
  • Loading branch information
paulgv committed Aug 9, 2018
1 parent 16a4cba commit 10ba9ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ export default function (userOptions) {
}

// Generate localized routes
const pagesDir = this.options.dir && this.options.dir.pages ? this.options.dir.pages : 'pages'
this.extendRoutes((routes) => {
const localizedRoutes = makeRoutes(routes, {
...options,
pagesDir: this.options.dir.pages
pagesDir,
})
routes.splice(0, routes.length)
routes.unshift(...localizedRoutes)
Expand Down

0 comments on commit 10ba9ed

Please sign in to comment.