From 910eb97d85f0089c84d978c190a630806c295019 Mon Sep 17 00:00:00 2001 From: "Jacob.Kostenick" Date: Wed, 3 Feb 2021 10:06:30 -0800 Subject: [PATCH] add the ability to provide extra plugins to @mdx/loader --- dokz/src/plugin/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dokz/src/plugin/index.ts b/dokz/src/plugin/index.ts index c2ecef7..7a45d09 100644 --- a/dokz/src/plugin/index.ts +++ b/dokz/src/plugin/index.ts @@ -17,7 +17,7 @@ import { formatTitle } from '../components/support' const EXTENSIONS_TO_WATCH = ['.mdx', '.md'] -export function withDokz(nextConfig = {} as any) { +export function withDokz(nextConfig = {} as any, remarkPlugins = [], rehypePlugins = []) { // .on('change', writeMdxIndex) nextConfig.pageExtensions = unique([ ...(nextConfig.pageExtensions || []), @@ -71,8 +71,9 @@ export function withDokz(nextConfig = {} as any) { ) plugin(tree) }, + ...(remarkPlugins || []) ], - rehypePlugins: [injectCodeToPlayground], + rehypePlugins: [injectCodeToPlayground, ...(rehypePlugins || [])], }, })(nextConfig) }