fix: undefined remarkPluginFrontmatter after calling render method (#5927)

* Update vite-plugin-content-assets.ts

* Add changeset for #5927

Signed-off-by: Anders Kaseorg <andersk@mit.edu>

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Co-authored-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
银河渡舟 2023-01-27 03:47:09 +08:00 committed by GitHub
parent 1c7eef308e
commit 322e059d0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Fix undefined `remarkPluginFrontmatter` after calling `render` method

View file

@ -34,7 +34,7 @@ export function astroDelayedAssetPlugin({ mode }: { mode: string }): Plugin {
if (isDelayedAsset(id)) {
const basePath = id.split('?')[0];
const code = `
export { Content, getHeadings } from ${JSON.stringify(basePath)};
export { Content, getHeadings, frontmatter } from ${JSON.stringify(basePath)};
export const collectedLinks = ${JSON.stringify(LINKS_PLACEHOLDER)};
export const collectedStyles = ${JSON.stringify(STYLES_PLACEHOLDER)};
`;