From 82bf564168083a8322a440747f77759ffbf194df Mon Sep 17 00:00:00 2001 From: Mashiro Date: Sat, 23 Oct 2021 04:05:53 +0800 Subject: [PATCH] Remove deprecated `extendDefaultPlugins` method of svgo (#17399) --- build/generate-images.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build/generate-images.js b/build/generate-images.js index b6616810a76d5..b8284b1be2fc2 100755 --- a/build/generate-images.js +++ b/build/generate-images.js @@ -1,5 +1,5 @@ import imageminZopfli from 'imagemin-zopfli'; -import {optimize, extendDefaultPlugins} from 'svgo'; +import {optimize} from 'svgo'; import {fabric} from 'fabric'; import fs from 'fs'; import {resolve, dirname} from 'path'; @@ -25,13 +25,14 @@ function loadSvg(svg) { async function generate(svg, outputFile, {size, bg}) { if (outputFile.endsWith('.svg')) { const {data} = optimize(svg, { - plugins: extendDefaultPlugins([ + plugins: [ + 'preset-default', 'removeDimensions', { name: 'addAttributesToSVGElement', params: {attributes: [{width: size}, {height: size}]} }, - ]), + ], }); await writeFile(outputFile, data); return;