mirror of
https://codeberg.org/forgejo/forgejo
synced 2024-11-22 01:44:24 +01:00
Remove deprecated extendDefaultPlugins
method of svgo (#17399)
This commit is contained in:
parent
d1a056fe52
commit
82bf564168
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue