Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove useless js-loader in front of mdx-loader #8972

Merged
merged 1 commit into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/docusaurus-plugin-content-blog/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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: {
Expand Down
2 changes: 0 additions & 2 deletions packages/docusaurus-plugin-content-docs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ export default async function pluginContentDocs(
},

configureWebpack(_config, isServer, utils, content) {
const {getJSLoader} = utils;
const {
rehypePlugins,
remarkPlugins,
Expand Down Expand Up @@ -263,7 +262,6 @@ export default async function pluginContentDocs(
test: /\.mdx?$/i,
include: contentDirs,
use: [
getJSLoader({isServer}),
{
loader: require.resolve('@docusaurus/mdx-loader'),
options: {
Expand Down
3 changes: 1 addition & 2 deletions packages/docusaurus-plugin-content-pages/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export default function pluginContentPages(
);
},

configureWebpack(config, isServer, {getJSLoader}) {
configureWebpack() {
const {
admonitions,
rehypePlugins,
Expand All @@ -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: {
Expand Down
3 changes: 1 addition & 2 deletions packages/docusaurus/src/server/plugins/synthetic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -117,7 +117,6 @@ export function createMDXFallbackPlugin({
test: /\.mdx?$/i,
exclude: getMDXFallbackExcludedPaths(),
use: [
getJSLoader({isServer}),
{
loader: require.resolve('@docusaurus/mdx-loader'),
options: mdxLoaderOptions,
Expand Down
3 changes: 2 additions & 1 deletion website/src/plugins/changelog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down