Skip to content

🎥 Make videos programmatically with React

Update overwriting-webpack-config.mdx

Jonny Burger91b4b98245c4
diff --git a/packages/docs/docs/overwriting-webpack-config.mdx b/packages/docs/docs/overwriting-webpack-config.mdx
index 8c7ea047cd..4bd6714a2c 100644
--- a/packages/docs/docs/overwriting-webpack-config.mdx
+++ b/packages/docs/docs/overwriting-webpack-config.mdx
@@ -242,9 +242,18 @@ export const enableSvgr: WebpackOverrideFn = (currentConfiguration) => {
resourceQuery: { not: [/url/] }, // Exclude react component if *.svg?url
use: ["@svgr/webpack"],
},
- ...(currentConfiguration.module?.rules
- ? currentConfiguration.module.rules
- : []),
+ ...(currentConfiguration.module?.rules ?? []).map((r) => {
+ if (!r.test?.toString().includes("svg")) {
+ return r;
+ }
+ return {
+ ...r,
+ // Remove Remotion loading SVGs as a URL
+ test: new RegExp(
+ r.test.toString().replace(/svg\|/g, "").slice(1, -1),
+ ),
+ };
+ }),
],
},
};