diff --git a/src/node/markdownToVue.ts b/src/node/markdownToVue.ts index cc94049c..d6097430 100644 --- a/src/node/markdownToVue.ts +++ b/src/node/markdownToVue.ts @@ -33,7 +33,12 @@ export function createMarkdownToVueRenderFn( const start = Date.now() const { content, data: frontmatter } = matter(src) - const { html, data } = md.render(content) + let { html, data } = md.render(content) + + // avoid env variables being replaced by vite + html = html + .replace(/import\.meta/g, 'import.meta') + .replace(/process\.env/g, 'process.env') // TODO validate data.links? const pageData: PageData = {