Skip to content

Commit

Permalink
fix: Fix routes generation with nuxt generate (#95)
Browse files Browse the repository at this point in the history
Fixes #82
  • Loading branch information
achretien authored and paulgv committed Jun 6, 2018
1 parent 0aaecfa commit ff127a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/helpers/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const makeRoutes = (baseRoutes, {
for (let i = 0, length1 = componentOptions.locales.length; i < length1; i++) {
const locale = componentOptions.locales[i]
let { name, path } = route
const localizedRoute = { ...route, children: [] }
const localizedRoute = { ...route }

// Skip if locale not in module's configuration
if (locales.indexOf(locale) === -1) {
Expand All @@ -64,6 +64,7 @@ export const makeRoutes = (baseRoutes, {

// Generate localized children routes if any
if (route.children) {
localizedRoute.children = []
for (let i = 0, length1 = route.children.length; i < length1; i++) {
localizedRoute.children = localizedRoute.children.concat(buildLocalizedRoutes(route.children[i], { locales: [locale] }, true))
}
Expand Down

0 comments on commit ff127a5

Please sign in to comment.