Skip `compileMdx` step for regular `md` files
Hi, first of all thanks for the great framework, really enjoyed it!
Issue
At the moment both md and mdx files are treated as MDX and get prepared by compileMdx (@mdx-js) process. This leads to 2 problems:
- increased memory consumption. For ~2000 small md files (sample file) we need over 8GB for next build which make it impossible to build on Vercel for example
- we have a lot of black-listed words and symbols in md (e.g.
import,export,{,<) which make it hard to develop or migrate documentation
Solution
Opt-out / opt-in option for skipping MDX processing for md files and use simple md-html convertion byremark-html instead
-- OR --
Workaround to get this to work. Perhaps custom webpack loader for different types of files (might be too abtract IMO) or any other way to exclude md files from MDX processing and apply simple md-html conversion without extracting a lot of internal implementation details of Nextra
Thanks!
An option to configure extensions sounds good to me, by default it can be ["md", "mdx"] but you can set it to ["mdx"] only.
Sounds good, can we keep the other Nextra features applied to md-files with this approach? (layouts, ssg, etc.)
Oh I misunderstood what you meant — but that makes total sense still. The layouts and built-in components still rely on MDX compiler but we can look into a more performant solution for Markdown files.