Add Nuxt module for MDX
See original GitHub issueAdd 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.
Alternatives
What are the alternative solutions? Please describe what else you have considered?
- Create your own custom router with this kind of gymnastics.
- Manually create module in user land (Non beginner-friendly.)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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. 🙏
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?