From 97c3da378902f14e269ac39c6fceb4f4e5a0b0bb Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 12 Mar 2024 20:48:01 +0000 Subject: [PATCH] Fix svgo plugins Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- svgo.config.mjs | 6 ------ webpack.config.js | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 6 deletions(-) delete mode 100644 svgo.config.mjs diff --git a/svgo.config.mjs b/svgo.config.mjs deleted file mode 100644 index 17934add90..0000000000 --- a/svgo.config.mjs +++ /dev/null @@ -1,6 +0,0 @@ -export default { - plugins: [ - // generates a viewbox if missing - { name: "removeDimensions" }, - ], -}; diff --git a/webpack.config.js b/webpack.config.js index 682e61ed8f..d61c15bf41 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -542,6 +542,20 @@ module.exports = (env, argv) => { }, // props set on the svg will override defaults expandProps: "end", + svgoConfig: { + plugins: [ + { + name: "preset-default", + params: { + overrides: { + removeViewBox: false, + }, + }, + }, + // generates a viewbox if missing + { name: "removeDimensions" }, + ], + }, /** * Forwards the React ref to the root SVG element * Useful when using things like `asChild` in