Skip to content

Commit

Permalink
fix(mdx-loader): use inlineMarkdownAssetFileLoader for
Browse files Browse the repository at this point in the history
to prevent pages' thumbnails from being inserted into the page as base64 data
  • Loading branch information
Zwyx committed Oct 4, 2023
1 parent f7d39d2 commit 9a1d41c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/docusaurus-mdx-loader/src/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import type {LoaderContext} from 'webpack';
type Pluggable = any; // TODO fix this asap

const {
loaders: {inlineMarkdownImageFileLoader},
loaders: {inlineMarkdownAssetFileLoader},
} = getFileLoaderUtils();

export type MDXPlugin = Pluggable;
Expand Down Expand Up @@ -92,7 +92,7 @@ function createAssetsExportCode(assets: unknown) {
if (typeof assetValue === 'string' && assetValue.startsWith('./')) {
// TODO do we have other use-cases than image assets?
// Probably not worth adding more support, as we want to move to Webpack 5 new asset system (https://github.com/facebook/docusaurus/pull/4708)
const inlineLoader = inlineMarkdownImageFileLoader;
const inlineLoader = inlineMarkdownAssetFileLoader;
return `require("${inlineLoader}${escapePath(assetValue)}").default`;
}
return undefined;
Expand Down

0 comments on commit 9a1d41c

Please sign in to comment.