Skip to content

Commit d746f68

Browse files
authored
fix: remove useless js-loader in front of mdx-loader (facebook#8972)
1 parent 905fe7f commit d746f68

File tree

5 files changed

+5
-9
lines changed

5 files changed

+5
-9
lines changed

packages/docusaurus-plugin-content-blog/src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ export default async function pluginContentBlog(
359359
return translateContent(content, translationFiles);
360360
},
361361

362-
configureWebpack(_config, isServer, {getJSLoader}, content) {
362+
configureWebpack(_config, isServer, utils, content) {
363363
const {
364364
admonitions,
365365
rehypePlugins,
@@ -399,7 +399,6 @@ export default async function pluginContentBlog(
399399
// Trailing slash is important, see https://github.com/facebook/docusaurus/pull/3970
400400
.map(addTrailingPathSeparator),
401401
use: [
402-
getJSLoader({isServer}),
403402
{
404403
loader: require.resolve('@docusaurus/mdx-loader'),
405404
options: {

packages/docusaurus-plugin-content-docs/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ export default async function pluginContentDocs(
228228
},
229229

230230
configureWebpack(_config, isServer, utils, content) {
231-
const {getJSLoader} = utils;
232231
const {
233232
rehypePlugins,
234233
remarkPlugins,
@@ -263,7 +262,6 @@ export default async function pluginContentDocs(
263262
test: /\.mdx?$/i,
264263
include: contentDirs,
265264
use: [
266-
getJSLoader({isServer}),
267265
{
268266
loader: require.resolve('@docusaurus/mdx-loader'),
269267
options: {

packages/docusaurus-plugin-content-pages/src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export default function pluginContentPages(
186186
);
187187
},
188188

189-
configureWebpack(config, isServer, {getJSLoader}) {
189+
configureWebpack() {
190190
const {
191191
admonitions,
192192
rehypePlugins,
@@ -209,7 +209,6 @@ export default function pluginContentPages(
209209
// Trailing slash is important, see https://github.com/facebook/docusaurus/pull/3970
210210
.map(addTrailingPathSeparator),
211211
use: [
212-
getJSLoader({isServer}),
213212
{
214213
loader: require.resolve('@docusaurus/mdx-loader'),
215214
options: {

packages/docusaurus/src/server/plugins/synthetic.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export function createMDXFallbackPlugin({
8585
version: {type: 'synthetic'},
8686
// Synthetic, the path doesn't matter much
8787
path: '.',
88-
configureWebpack(config, isServer, {getJSLoader}) {
88+
configureWebpack(config) {
8989
// We need the mdx fallback loader to exclude files that were already
9090
// processed by content plugins mdx loaders. This works, but a bit
9191
// hacky... Not sure there's a way to handle that differently in webpack
@@ -117,7 +117,6 @@ export function createMDXFallbackPlugin({
117117
test: /\.mdx?$/i,
118118
exclude: getMDXFallbackExcludedPaths(),
119119
use: [
120-
getJSLoader({isServer}),
121120
{
122121
loader: require.resolve('@docusaurus/mdx-loader'),
123122
options: mdxLoaderOptions,

website/src/plugins/changelog/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ async function ChangelogPlugin(context, options) {
138138
'default',
139139
);
140140
// Redirect the metadata path to our folder
141-
config.module.rules[0].use[1].options.metadataPath = (mdxPath) => {
141+
const mdxLoader = config.module.rules[0].use[0];
142+
mdxLoader.options.metadataPath = (mdxPath) => {
142143
// Note that metadataPath must be the same/in-sync as
143144
// the path from createData for each MDX.
144145
const aliasedPath = aliasedSitePath(mdxPath, context.siteDir);

0 commit comments

Comments
 (0)