Skip to content

Commit 318fad9

Browse files
committed
refactor: 2 jsToTreeNode calls -> 1
1 parent f894e2a commit 318fad9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/integrations/mdx/src/plugins.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,12 @@ export function rehypeApplyFrontmatterExport(pageFrontmatter: Record<string, any
5656
const { frontmatter: injectedFrontmatter } = safelyGetAstroData(vfile.data);
5757
const frontmatter = { ...injectedFrontmatter, ...pageFrontmatter };
5858
const exportNodes = [
59-
jsToTreeNode(`export const frontmatter = ${JSON.stringify(frontmatter)};`),
6059
jsToTreeNode(
61-
`export const _internal = { injectedFrontmatter: ${JSON.stringify(injectedFrontmatter)} };`
60+
`export const frontmatter = ${JSON.stringify(
61+
frontmatter
62+
)};\nexport const _internal = { injectedFrontmatter: ${JSON.stringify(
63+
injectedFrontmatter
64+
)} };`
6265
),
6366
];
6467
if (frontmatter.layout) {

0 commit comments

Comments
 (0)