diff options
author | Mashiro <moezhx@outlook.com> | 2021-10-23 04:05:53 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-22 22:05:53 +0200 |
commit | 82bf564168083a8322a440747f77759ffbf194df (patch) | |
tree | 4abcb41182a4ff5f43db83c8d8f9a5b8c20e9507 /build | |
parent | d1a056fe523f91055e5b15e8c91244862dbf2f92 (diff) | |
download | gitea-82bf564168083a8322a440747f77759ffbf194df.tar.gz gitea-82bf564168083a8322a440747f77759ffbf194df.zip |
Remove deprecated `extendDefaultPlugins` method of svgo (#17399)
Diffstat (limited to 'build')
-rwxr-xr-x | build/generate-images.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/build/generate-images.js b/build/generate-images.js index b6616810a7..b8284b1be2 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; |