Expose settings to control the minification process(es)
See original GitHub issueš Feature
As a user Iād like to have more control over the minification process.
We have a Docusarus blog that we also use as a source to send email newsletters (about 500k). Iāve noticed that some screenshots are inlined as img src="data:image/png;base64,...". Iām guessing this is based on file size.
As I do not want to have the images in the payload in each email, Iād like to not have them inlined.
Have you read the Contributing Guidelines on issues?
Yes.
Has this been requested on Canny?
No.
Motivation
Itās nice to have some control over the minification process to support different use cases.
API Design
It would be nice to have some optional settings exposed for overriding the default behavior either in Docusaurus config or in the webpack config.
Have you tried building it?
Someone suggested building a remark plugin which seems overly complicated to me, but Iāll check it out.
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (8 by maintainers)

Top Related StackOverflow Question
Yeah absolutely. The PR solves my issue. In the mean time I will hack the value in node_modules.
Again, I would advise to lower the default inlining threshold to 2k or less in order to align with web perf best practices, but this fix lets me override the (imho) broken default via the env, so Iām happy with this.
Images in blog content are handled by
inlineMarkdownImageFileLoader, whose options cannot be overridden viaconfigureWebpackfor now. If it will be āregular loaderā, you could do something similar with the existing API:Perhaps this will be possible after migrating to asset modules in PR #4708, although the CRA approach by changing env var still looks better and clearer than using
configureWebpackwhich seems pretty hacky.