fix(core): restore core svg file-loader (#10820)

This commit is contained in:
Sébastien Lorber 2025-01-06 17:54:43 +01:00 committed by GitHub
parent 35259521e0
commit 97690abc94
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 56 additions and 15 deletions

View file

@ -43,6 +43,7 @@ type FileLoaderUtils = {
};
rules: {
images: () => RuleSetRule;
svgs: () => RuleSetRule;
fonts: () => RuleSetRule;
media: () => RuleSetRule;
otherAssets: () => RuleSetRule;
@ -119,6 +120,15 @@ function createFileLoaderUtils({
test: /\.(?:ico|jpe?g|png|gif|webp|avif)(?:\?.*)?$/i,
}),
/**
* The SVG rule is isolated on purpose: our SVGR plugin enhances it
* See https://github.com/facebook/docusaurus/pull/10820
*/
svgs: () => ({
use: [loaders.url({folder: 'images'})],
test: /\.svg$/i,
}),
fonts: () => ({
use: [loaders.url({folder: 'fonts'})],
test: /\.(?:woff2?|eot|ttf|otf)$/i,