mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-15 10:07:33 +02:00
fix: remove useless js-loader in front of mdx-loader (#8972)
This commit is contained in:
parent
905fe7f4b4
commit
d746f689ae
5 changed files with 5 additions and 9 deletions
|
@ -359,7 +359,7 @@ export default async function pluginContentBlog(
|
|||
return translateContent(content, translationFiles);
|
||||
},
|
||||
|
||||
configureWebpack(_config, isServer, {getJSLoader}, content) {
|
||||
configureWebpack(_config, isServer, utils, content) {
|
||||
const {
|
||||
admonitions,
|
||||
rehypePlugins,
|
||||
|
@ -399,7 +399,6 @@ export default async function pluginContentBlog(
|
|||
// Trailing slash is important, see https://github.com/facebook/docusaurus/pull/3970
|
||||
.map(addTrailingPathSeparator),
|
||||
use: [
|
||||
getJSLoader({isServer}),
|
||||
{
|
||||
loader: require.resolve('@docusaurus/mdx-loader'),
|
||||
options: {
|
||||
|
|
|
@ -228,7 +228,6 @@ export default async function pluginContentDocs(
|
|||
},
|
||||
|
||||
configureWebpack(_config, isServer, utils, content) {
|
||||
const {getJSLoader} = utils;
|
||||
const {
|
||||
rehypePlugins,
|
||||
remarkPlugins,
|
||||
|
@ -263,7 +262,6 @@ export default async function pluginContentDocs(
|
|||
test: /\.mdx?$/i,
|
||||
include: contentDirs,
|
||||
use: [
|
||||
getJSLoader({isServer}),
|
||||
{
|
||||
loader: require.resolve('@docusaurus/mdx-loader'),
|
||||
options: {
|
||||
|
|
|
@ -186,7 +186,7 @@ export default function pluginContentPages(
|
|||
);
|
||||
},
|
||||
|
||||
configureWebpack(config, isServer, {getJSLoader}) {
|
||||
configureWebpack() {
|
||||
const {
|
||||
admonitions,
|
||||
rehypePlugins,
|
||||
|
@ -209,7 +209,6 @@ export default function pluginContentPages(
|
|||
// Trailing slash is important, see https://github.com/facebook/docusaurus/pull/3970
|
||||
.map(addTrailingPathSeparator),
|
||||
use: [
|
||||
getJSLoader({isServer}),
|
||||
{
|
||||
loader: require.resolve('@docusaurus/mdx-loader'),
|
||||
options: {
|
||||
|
|
|
@ -85,7 +85,7 @@ export function createMDXFallbackPlugin({
|
|||
version: {type: 'synthetic'},
|
||||
// Synthetic, the path doesn't matter much
|
||||
path: '.',
|
||||
configureWebpack(config, isServer, {getJSLoader}) {
|
||||
configureWebpack(config) {
|
||||
// We need the mdx fallback loader to exclude files that were already
|
||||
// processed by content plugins mdx loaders. This works, but a bit
|
||||
// hacky... Not sure there's a way to handle that differently in webpack
|
||||
|
@ -117,7 +117,6 @@ export function createMDXFallbackPlugin({
|
|||
test: /\.mdx?$/i,
|
||||
exclude: getMDXFallbackExcludedPaths(),
|
||||
use: [
|
||||
getJSLoader({isServer}),
|
||||
{
|
||||
loader: require.resolve('@docusaurus/mdx-loader'),
|
||||
options: mdxLoaderOptions,
|
||||
|
|
|
@ -138,7 +138,8 @@ async function ChangelogPlugin(context, options) {
|
|||
'default',
|
||||
);
|
||||
// Redirect the metadata path to our folder
|
||||
config.module.rules[0].use[1].options.metadataPath = (mdxPath) => {
|
||||
const mdxLoader = config.module.rules[0].use[0];
|
||||
mdxLoader.options.metadataPath = (mdxPath) => {
|
||||
// Note that metadataPath must be the same/in-sync as
|
||||
// the path from createData for each MDX.
|
||||
const aliasedPath = aliasedSitePath(mdxPath, context.siteDir);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue