mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-20 20:46:58 +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
|
@ -29,6 +29,9 @@ const DEFAULT_OPTIONS = {
|
|||
blogPostComponent: '@theme/BlogPostPage',
|
||||
blogTagsListComponent: '@theme/BlogTagsListPage',
|
||||
blogTagsPostsComponent: '@theme/BlogTagsPostsPage',
|
||||
remarkPlugins: [],
|
||||
rehypePlugins: [],
|
||||
prismTheme: '',
|
||||
};
|
||||
|
||||
module.exports = function(context, opts) {
|
||||
|
@ -341,6 +344,7 @@ module.exports = function(context, opts) {
|
|||
},
|
||||
|
||||
configureWebpack(config, isServer, {getBabelLoader, getCacheLoader}) {
|
||||
const {rehypePlugins, remarkPlugins, prismTheme} = options;
|
||||
return {
|
||||
module: {
|
||||
rules: [
|
||||
|
@ -350,7 +354,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, './markdownLoader.js'),
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue