Skip to content

fix(v2): fix markdown images always using webpack url-loader - #3180

Merged
slorber merged 2 commits into
masterfrom
slorber/fix-mdx-image-loader
Jul 31, 2020
Merged

slorber merged 2 commits into
masterfrom
slorber/fix-mdx-image-loader

Conversation

@slorber

@slorber slorber commented Jul 31, 2020

Copy link
Copy Markdown
Collaborator

Motivation

Markdown images are converted to webpack requires, but to avoid conflicts when requiring images with the ideal-image plugin, we force an inline loader with the inline loader syntax directly in the require call.

Bug: we used URL loader instead of file loader, that always inline images as base64 in final documents.
We should ensure that our config for those inline loaders are "in sync" with the regular image loaders, so I colocated those.

This is not ideal but good enough, and I don't know to solve the loader conflict with ideal-image without introducing a breaking change somewhere.

Something to discuss: maybe all markdown image tags should go through the ideal image plugin? This is also a behavior change because currently, the user needs to use JSX explicitly to use ideal images.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Dogfooding / preview

@slorber
slorber requested a review from yangshun as a code owner July 31, 2020 18:38
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jul 31, 2020
@docusaurus-bot

Copy link
Copy Markdown
Contributor

@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label Jul 31, 2020
@docusaurus-bot

Copy link
Copy Markdown
Contributor

@slorber
slorber merged commit 62c61c9 into master Jul 31, 2020
@yangshun
yangshun deleted the slorber/fix-mdx-image-loader branch August 26, 2020 02:00
mrizwanashiq pushed a commit to mrizwanashiq/docusaurus that referenced this pull request Jun 25, 2026
* fix markdown images always using file-loader + move assets to a dedicated subfolder

* update snapshot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants