Skip to content

Commit 8f0cbb9

Browse files
committed
fix(node): add plugin basePath to generated route map
1 parent 5f3e0ff commit 8f0cbb9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/gatsby/lib/pages-creator.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,12 @@ export default class PagesCreator {
213213
}
214214

215215
writeRouteMap (filename) {
216+
const pathPrefix = getOption('basePath')
216217
const map = _.mapValues(this.routeMap, route => ({
217-
path: route.path,
218-
scopes: _.mapValues(route.scopes, 'path')
218+
path: path.join(pathPrefix, route.path),
219+
scopes: _.mapValues(route.scopes, sroute => (
220+
path.join(pathPrefix, sroute.path)
221+
))
219222
}))
220223
const content = `"use strict";\n\nmodule.exports = ${JSON.stringify(map, null, 2)};`
221224
try {

0 commit comments

Comments
 (0)