Skip to content

Commit

Permalink
Remove deprecated extendDefaultPlugins method of svgo (#17399)
Browse files Browse the repository at this point in the history
  • Loading branch information
mashirozx authored Oct 22, 2021
1 parent d1a056f commit 82bf564
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions build/generate-images.js
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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;
Expand Down

0 comments on commit 82bf564

Please sign in to comment.