From 915949aefe82678b836df240a32fc1d780c31a81 Mon Sep 17 00:00:00 2001 From: MrPropre <36234981+MrPropre@users.noreply.github.com> Date: Tue, 20 Apr 2021 16:12:26 +0200 Subject: [PATCH] Fix SVGO config --- src/OptimizerChainFactory.php | 2 +- svgo.config.js | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 svgo.config.js diff --git a/src/OptimizerChainFactory.php b/src/OptimizerChainFactory.php index 634bad6..3d3470d 100644 --- a/src/OptimizerChainFactory.php +++ b/src/OptimizerChainFactory.php @@ -40,7 +40,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..ec88750 --- /dev/null +++ b/svgo.config.js @@ -0,0 +1,14 @@ +const { extendDefaultPlugins } = require('svgo') + +module.exports = { + plugins: extendDefaultPlugins([ + { + name: 'cleanupIDs', + active: false + }, + { + name: 'removeViewBox', + active: false + } + ]) +}