Skip to content

Commit

Permalink
fix: replace last 'export default MDXContent;' (shuding#2045)
Browse files Browse the repository at this point in the history
Co-authored-by: Dimitri POSTOLOV <dmytropostolov@gmail.com>
  • Loading branch information
soata and dimaMachina committed Jul 8, 2023
1 parent 5e6799d commit 40c5aea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,10 @@ const __nextraPageOptions = {
(themeConfigImport && 'themeConfig: __nextra_themeConfig')
}
}
${finalResult.replace('export default MDXContent;', '')}
${
// Remove the last match of `export default MDXContent` because it can be existed in the raw MDX file
finalResult.slice(0, finalResult.lastIndexOf('export default MDXContent;'))
}
if (process.env.NODE_ENV !== 'production') {
__nextraPageOptions.hot = module.hot
__nextraPageOptions.pageOptsChecksum = ${stringifiedChecksum}
Expand Down

0 comments on commit 40c5aea

Please sign in to comment.