mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-15 18:17:35 +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);
|
return translateContent(content, translationFiles);
|
||||||
},
|
},
|
||||||
|
|
||||||
configureWebpack(_config, isServer, {getJSLoader}, content) {
|
configureWebpack(_config, isServer, utils, content) {
|
||||||
const {
|
const {
|
||||||
admonitions,
|
admonitions,
|
||||||
rehypePlugins,
|
rehypePlugins,
|
||||||
|
@ -399,7 +399,6 @@ export default async function pluginContentBlog(
|
||||||
// Trailing slash is important, see https://github.com/facebook/docusaurus/pull/3970
|
// Trailing slash is important, see https://github.com/facebook/docusaurus/pull/3970
|
||||||
.map(addTrailingPathSeparator),
|
.map(addTrailingPathSeparator),
|
||||||
use: [
|
use: [
|
||||||
getJSLoader({isServer}),
|
|
||||||
{
|
{
|
||||||
loader: require.resolve('@docusaurus/mdx-loader'),
|
loader: require.resolve('@docusaurus/mdx-loader'),
|
||||||
options: {
|
options: {
|
||||||
|
|
|
@ -228,7 +228,6 @@ export default async function pluginContentDocs(
|
||||||
},
|
},
|
||||||
|
|
||||||
configureWebpack(_config, isServer, utils, content) {
|
configureWebpack(_config, isServer, utils, content) {
|
||||||
const {getJSLoader} = utils;
|
|
||||||
const {
|
const {
|
||||||
rehypePlugins,
|
rehypePlugins,
|
||||||
remarkPlugins,
|
remarkPlugins,
|
||||||
|
@ -263,7 +262,6 @@ export default async function pluginContentDocs(
|
||||||
test: /\.mdx?$/i,
|
test: /\.mdx?$/i,
|
||||||
include: contentDirs,
|
include: contentDirs,
|
||||||
use: [
|
use: [
|
||||||
getJSLoader({isServer}),
|
|
||||||
{
|
{
|
||||||
loader: require.resolve('@docusaurus/mdx-loader'),
|
loader: require.resolve('@docusaurus/mdx-loader'),
|
||||||
options: {
|
options: {
|
||||||
|
|
|
@ -186,7 +186,7 @@ export default function pluginContentPages(
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
configureWebpack(config, isServer, {getJSLoader}) {
|
configureWebpack() {
|
||||||
const {
|
const {
|
||||||
admonitions,
|
admonitions,
|
||||||
rehypePlugins,
|
rehypePlugins,
|
||||||
|
@ -209,7 +209,6 @@ export default function pluginContentPages(
|
||||||
// Trailing slash is important, see https://github.com/facebook/docusaurus/pull/3970
|
// Trailing slash is important, see https://github.com/facebook/docusaurus/pull/3970
|
||||||
.map(addTrailingPathSeparator),
|
.map(addTrailingPathSeparator),
|
||||||
use: [
|
use: [
|
||||||
getJSLoader({isServer}),
|
|
||||||
{
|
{
|
||||||
loader: require.resolve('@docusaurus/mdx-loader'),
|
loader: require.resolve('@docusaurus/mdx-loader'),
|
||||||
options: {
|
options: {
|
||||||
|
|
|
@ -85,7 +85,7 @@ export function createMDXFallbackPlugin({
|
||||||
version: {type: 'synthetic'},
|
version: {type: 'synthetic'},
|
||||||
// Synthetic, the path doesn't matter much
|
// Synthetic, the path doesn't matter much
|
||||||
path: '.',
|
path: '.',
|
||||||
configureWebpack(config, isServer, {getJSLoader}) {
|
configureWebpack(config) {
|
||||||
// We need the mdx fallback loader to exclude files that were already
|
// We need the mdx fallback loader to exclude files that were already
|
||||||
// processed by content plugins mdx loaders. This works, but a bit
|
// processed by content plugins mdx loaders. This works, but a bit
|
||||||
// hacky... Not sure there's a way to handle that differently in webpack
|
// hacky... Not sure there's a way to handle that differently in webpack
|
||||||
|
@ -117,7 +117,6 @@ export function createMDXFallbackPlugin({
|
||||||
test: /\.mdx?$/i,
|
test: /\.mdx?$/i,
|
||||||
exclude: getMDXFallbackExcludedPaths(),
|
exclude: getMDXFallbackExcludedPaths(),
|
||||||
use: [
|
use: [
|
||||||
getJSLoader({isServer}),
|
|
||||||
{
|
{
|
||||||
loader: require.resolve('@docusaurus/mdx-loader'),
|
loader: require.resolve('@docusaurus/mdx-loader'),
|
||||||
options: mdxLoaderOptions,
|
options: mdxLoaderOptions,
|
||||||
|
|
|
@ -138,7 +138,8 @@ async function ChangelogPlugin(context, options) {
|
||||||
'default',
|
'default',
|
||||||
);
|
);
|
||||||
// Redirect the metadata path to our folder
|
// 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
|
// Note that metadataPath must be the same/in-sync as
|
||||||
// the path from createData for each MDX.
|
// the path from createData for each MDX.
|
||||||
const aliasedPath = aliasedSitePath(mdxPath, context.siteDir);
|
const aliasedPath = aliasedSitePath(mdxPath, context.siteDir);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue