Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose @mdx-js/loader configuration #101

Open
silvenon opened this issue Sep 17, 2018 · 0 comments
Open

Expose @mdx-js/loader configuration #101

silvenon opened this issue Sep 17, 2018 · 0 comments

Comments

@silvenon
Copy link

silvenon commented Sep 17, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant