Configuration
Changing and extending the configuration.
Configuration can be done through options or by adding or customizing styles, components or other existing implementations.
Options
Configure the name
, repository
, cwd
, pattern
and other options like rehype
/remark
plugins.
For convenience, you can re-use the fields in package.json
, if they are
defined.
import packageJsonFile from './package.json';
const options: BundleMDXOptions = {
name: packageJsonFile.name,
repository: packageJsonFile.repository,
// other options
license: packageJsonFile.license,
author: packageJsonFile.author,
baseRoute: '/',
logo: '/vite.svg',
pattern: '**/*.mdx',
cwd: '/docs',
toc: true,
mdxBundlerOptions: {
mdxOptions: {
jsxImportSource: 'preact',
// rehype/remark plugins...
remarkPlugins: [remarkGfm, remarkFrontmatter, remarkMdxFrontmatter],
rehypePlugins: [
[
rehypePrism,
{
defaultLanguage: 'bash',
},
],
rehypeSlug,
],
},
},
};
export default options;
Bring your own!
Use-case specific configurations and implementations are kept to a minimum. Adding additional solutions is recommended.