Skip to content

Commit cc54090

Browse files
mashirozxStelios Malathouras
authored and
Stelios Malathouras
committed
Remove deprecated extendDefaultPlugins method of svgo (go-gitea#17399)
1 parent f6a7680 commit cc54090

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

build/generate-images.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import imageminZopfli from 'imagemin-zopfli';
2-
import {optimize, extendDefaultPlugins} from 'svgo';
2+
import {optimize} from 'svgo';
33
import {fabric} from 'fabric';
44
import fs from 'fs';
55
import {resolve, dirname} from 'path';
@@ -25,13 +25,14 @@ function loadSvg(svg) {
2525
async function generate(svg, outputFile, {size, bg}) {
2626
if (outputFile.endsWith('.svg')) {
2727
const {data} = optimize(svg, {
28-
plugins: extendDefaultPlugins([
28+
plugins: [
29+
'preset-default',
2930
'removeDimensions',
3031
{
3132
name: 'addAttributesToSVGElement',
3233
params: {attributes: [{width: size}, {height: size}]}
3334
},
34-
]),
35+
],
3536
});
3637
await writeFile(outputFile, data);
3738
return;

0 commit comments

Comments
 (0)