Skip to content

Commit

Permalink
ada
Browse files Browse the repository at this point in the history
  • Loading branch information
dimaMachina committed Jul 8, 2023
1 parent 1b6ae07 commit 8994d24
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/real-games-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'nextra': patch
---

replace last match of `export default MDXContent;`
5 changes: 4 additions & 1 deletion packages/nextra/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;).*$/, '$1')}
${
// 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 8994d24

Please sign in to comment.