Skip to content

Commit cfced96

Browse files
committed
Re-add the match-path rewrites
1 parent 4bf745d commit cfced96

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/gatsby-node.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,18 @@ exports.onPostBuild = async (
5050
}
5151
)
5252
}
53-
// return {
54-
// fromPath: page.matchPath,
55-
// toPath: page.path,
56-
// }
53+
if (
54+
pluginOptions.generateMatchPathRewrites &&
55+
page.matchPath !== page.path
56+
) {
57+
rewrites.push({
58+
fromPath: page.matchPath,
59+
toPath: page.path,
60+
})
61+
}
5762
})
5863
reporter.info(
59-
`[gatsby-plugin-netlify] Creating ${count} SSR redirect${
64+
`[gatsby-plugin-netlify] Created ${count} SSR redirect${
6065
count === 1 ? `` : `s`
6166
}...`
6267
)

0 commit comments

Comments
 (0)