aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2021-08-17 07:32:48 +0200
committerGitHub <noreply@github.com>2021-08-17 01:32:48 -0400
commitea07726dc193c41c60e26c25ad705059bd4f6555 (patch)
tree5d3191bd5a1968893e599eadca279a3f527617b9 /build
parentcf4328359bb765ebccc592d8fe50cd8190455220 (diff)
downloadgitea-ea07726dc193c41c60e26c25ad705059bd4f6555.tar.gz
gitea-ea07726dc193c41c60e26c25ad705059bd4f6555.zip
Update JS dependencies (#16708)
* Update JS dependencies - Update all JS dependencies - Adapt to recent webpack changes - Add new lint rules and fix issues - Regenerate SVGs and update svgo api usage Fixes: https://github.com/go-gitea/gitea/pull/16492 * adapt jest config and sort keys Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'build')
-rwxr-xr-xbuild/generate-svg.js21
1 files changed, 8 insertions, 13 deletions
diff --git a/build/generate-svg.js b/build/generate-svg.js
index 72c3be3cbd..f1704712f3 100755
--- a/build/generate-svg.js
+++ b/build/generate-svg.js
@@ -1,5 +1,5 @@
import fastGlob from 'fast-glob';
-import {optimize, extendDefaultPlugins} from 'svgo';
+import {optimize} from 'svgo';
import {resolve, parse, dirname} from 'path';
import fs from 'fs';
import {fileURLToPath} from 'url';
@@ -26,18 +26,13 @@ async function processFile(file, {prefix, fullName} = {}) {
}
const {data} = optimize(await readFile(file, 'utf8'), {
- plugins: extendDefaultPlugins([
- 'removeXMLNS',
- 'removeDimensions',
- {
- name: 'addClassesToSVGElement',
- params: {classNames: ['svg', name]},
- },
- {
- name: 'addAttributesToSVGElement',
- params: {attributes: [{'width': '16'}, {'height': '16'}, {'aria-hidden': 'true'}]},
- },
- ]),
+ plugins: [
+ {name: 'preset-default'},
+ {name: 'removeXMLNS'},
+ {name: 'removeDimensions'},
+ {name: 'addClassesToSVGElement', params: {classNames: ['svg', name]}},
+ {name: 'addAttributesToSVGElement', params: {attributes: [{'width': '16'}, {'height': '16'}, {'aria-hidden': 'true'}]}},
+ ],
});
await writeFile(resolve(outputDir, `${name}.svg`), data);
}