x0
x0 copied to clipboard
Expose @mdx-js/loader configuration
I'm not sure if there's currently a way to extend or override MDX configuration. One way could be to use smart merging. Another way could be to add a mdx field in x0 configuration in package.json:
"x0": {
"mdx": "./mdx.config.js"
}
// mdx.config.js
const math = require('remark-math')
const katex = require('rehype-katex')
module.exports = ({ defaultMdPlugins, defaultHastPlugins }) => ({
mdPlugins: [
...defaultMdPlugins,
math,
],
hastPlugins: [
...defaultHastPlugins,
katext,
],
})
I prefer the latter strategy. Even though it results in an additional configuration file, it's probably more straightforward to implement and use.