question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to enable export frontmatter as named exports?

See original GitHub issue

I’m using vite-plugin-md with Vite 2.9.3 I have found that this should work win default parameters, but it not works.

---
title: Hey
---

# Hello World
<script setup>
	import MyComp, { title } from './my-comp.md'
</script>
<template>
	<h1>{{ title }}</h1>
	<MyComp />
</template>
import not found: title

I tried to rewrite default parameters to expose frontmatter, but it not helps

      markdown({
        exposeFrontmatter: true
      }),

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
imSharacommented, Apr 24, 2022

Cool, It works again, thanks!

0reactions
yankeeinlondoncommented, Apr 23, 2022

Ok, i believe there’s a very good chance that v0.13.0 which I contributed to has fixed this now

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to pass data (frontmatter, exports) to layout? #27 - GitHub
I would like to know how to access named (non-default) exports of MDX files via webpack (Next.js) from the rendering component. My main...
Read more >
Frontmatter - MDX
MDX comes with a powerful and dynamic alternative to frontmatter, namely ESM ( import / export ). These exports: post.mdx. export const name...
Read more >
export - JavaScript - MDN Web Docs
Every module can have two different types of export, named export and default export. You can have multiple named exports per module but...
Read more >
Create and Edit Front Matter - Pressbooks User Guide
Click the name of the Front Matter content you'd like to edit (or hover over the ... their order and placement in the...
Read more >
remark-mdx-frontmatter - unified
A remark plugin for converting frontmatter metadata into MDX exports. ... If name is specified, the YAML content is exported as one single...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found