From 7fabc50f2c0e68780547fb63f642c1e3743b0ca4 Mon Sep 17 00:00:00 2001 From: Lyuboslav Alexandrov Date: Thu, 9 Mar 2023 17:32:28 +0200 Subject: [PATCH] Replaced the inline SVGO configuration with a config file that is compatible with SVGO@3 --- src/OptimizerChainFactory.php | 2 +- svgo.config.js | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 svgo.config.js diff --git a/src/OptimizerChainFactory.php b/src/OptimizerChainFactory.php index 20d6da0..889c068 100644 --- a/src/OptimizerChainFactory.php +++ b/src/OptimizerChainFactory.php @@ -42,7 +42,7 @@ public static function create(array $config = []): OptimizerChain ])) ->addOptimizer(new Svgo([ - '--disable={cleanupIDs,removeViewBox}', + '--config=svgo.config.js', ])) ->addOptimizer(new Gifsicle([ diff --git a/svgo.config.js b/svgo.config.js new file mode 100644 index 0000000..aba77c5 --- /dev/null +++ b/svgo.config.js @@ -0,0 +1,13 @@ +module.exports = { + plugins: [ + { + name: 'preset-default', + params: { + overrides: { + cleanupIDs: false, + removeViewBox: false, + }, + }, + }, + ], +}; \ No newline at end of file