mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-24 13:38:02 +02:00
feat(v2): allow passing remark, rehype, prismtheme to mdx-loader (#1543)
* feat(v2): allow passing remark, rehype, prismtheme to mdx-loader * nits
This commit is contained in:
parent
6a814ac64a
commit
8743ee5041
7 changed files with 49 additions and 10 deletions
|
@ -23,6 +23,9 @@ const DEFAULT_OPTIONS = {
|
|||
// TODO: Settle themeing.
|
||||
docLayoutComponent: '@theme/DocPage',
|
||||
docItemComponent: '@theme/DocItem',
|
||||
remarkPlugins: [],
|
||||
rehypePlugins: [],
|
||||
prismTheme: '',
|
||||
};
|
||||
|
||||
module.exports = function(context, opts) {
|
||||
|
@ -158,6 +161,7 @@ module.exports = function(context, opts) {
|
|||
},
|
||||
|
||||
configureWebpack(config, isServer, {getBabelLoader, getCacheLoader}) {
|
||||
const {rehypePlugins, remarkPlugins, prismTheme} = options;
|
||||
return {
|
||||
module: {
|
||||
rules: [
|
||||
|
@ -167,7 +171,14 @@ module.exports = function(context, opts) {
|
|||
use: [
|
||||
getCacheLoader(isServer),
|
||||
getBabelLoader(isServer),
|
||||
'@docusaurus/mdx-loader',
|
||||
{
|
||||
loader: '@docusaurus/mdx-loader',
|
||||
options: {
|
||||
remarkPlugins,
|
||||
rehypePlugins,
|
||||
prismTheme,
|
||||
},
|
||||
},
|
||||
{
|
||||
loader: path.resolve(__dirname, './markdown/index.js'),
|
||||
options: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue