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.

Add Nuxt module for MDX

See original GitHub issue

Add a Nuxt.js module to make MDX usage in Nuxt convenient in Nuxt.js

Currently I’m using MDX with Nuxt. The doesn’t come without the usual gymnastics of having to create a custom router to load the MDX files for pages.

Problem

Nuxt’s builder will ignore all non .vue files in the pages directory by default. In order to make this more convenient, we need to load the files programmatically inside a module.

After exploring this extensively I found that this cannot be done easily in user-land.

Expected behavior

The outcome should look something like the image shown below. MDX files are loaded seamlessly into Nuxt’s builder.

image

Alternatives

What are the alternative solutions? Please describe what else you have considered?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
codebender828commented, May 17, 2020

Yes. An easy way for people looking to get started with other integrations will be beneficial. I would suggest a page in the docs and in the readme. 🙏

1reaction
wooormcommented, May 16, 2020

I really have no experience with nuxt and almost none with react/vue, so I’m not the best person to speak on this.

Unfortunately we don’t yet list integrations on the readme. I think we should do that. Or maybe a new section on the website, under Getting Started, for Vue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

@nuxtjs/mdx - npm
The @nuxtjs/mdx module picks up all .mdx files used in your Nuxt app and converts them into Vue components. This makes it possible...
Read more >
nuxt-community/mdx-module - GitHub
MDX module for Nuxt. Contribute to nuxt-community/mdx-module development by creating an account ... Clone this repository; Install dependencies using yarn ...
Read more >
Installation - Nuxt MDX
Using MDX in your Nuxt project is only one command away. Installation. Requires a minimum Nuxt version of v2.10.0. See nuxt/nuxt.js#5854. Add @nuxtjs/mdx...
Read more >
Mdx Module - Nuxt
Replace markdown elements with Vue components with the MDX Provider. Development. Clone this repository; Install dependencies using yarn; Start development ...
Read more >
Loading .mdx (or other file extensions) as components in Nuxt
Add module to Nuxt config ... export default { // ... modules: [ 'path/to/load-mdx-module' ] // ... } ...
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