brillout / vite-plugin-mdx

Vite Plugin for MDX
MIT License
115 stars 36 forks source link

feat: accept a function for file-specific options #16

Closed aleclarson closed 3 years ago

aleclarson commented 3 years ago

For applying plugins conditionally based on filename.

mdx(filename => {
    return {
        remarkPlugins: filename.endsWith('foo.mdx') ? [myPlugin] : []
    }
})
aleclarson commented 3 years ago

Merge #15 first

brillout commented 3 years ago

LGTM. Only one thing: we should add some (small) docs about #16 and #15.

aleclarson commented 3 years ago

Agreed on #16. For #15, the docs already point to https://mdxjs.com/advanced/plugins, which does mention plugin tuples, but not presets. I'd say it's their responsibility to inform people about presets.

aleclarson commented 3 years ago

Docs added

brillout commented 3 years ago

@aleclarson There are merge conflicts. Feel free to do the merging.