From 546369e18bc37e9d0b168dd9429aa995d458042a Mon Sep 17 00:00:00 2001 From: WaitSpring Date: Sat, 18 Nov 2023 19:56:10 +0800 Subject: [PATCH] =?UTF-8?q?build:=20=F0=9F=93=A6=EF=B8=8F=20update=20SVGO?= =?UTF-8?q?=20settings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: WaitSpring --- .svgo.config.js | 23 +++++++++++++++++++++++ package.json | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 .svgo.config.js diff --git a/.svgo.config.js b/.svgo.config.js new file mode 100644 index 00000000..9743e64e --- /dev/null +++ b/.svgo.config.js @@ -0,0 +1,23 @@ +'use strict'; + +// https://www.mediawiki.org/wiki/Manual:Coding_conventions/SVG#Exemplified_safe_configuration +module.exports = { + js2svg: { + eol: 'lf', + finalNewline: false, + indent: '\t' + }, + multipass: true, + plugins: [ + { + name: 'preset-default', + params: { + overrides: { + removeViewBox: false + } + } + }, + 'removeRasterImages', + 'sortAttrs' + ] +}; diff --git a/package.json b/package.json index 13b83458..d83585e8 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "lint:styles": "stylelint \"**/*.{less,css}\"", "lint:i18n": "banana-checker --requireLowerCase=0 i18n/", "doc": "jsdoc -c jsdoc.json", - "minify-svg": "svgo --quiet --recursive --folder resources/", + "minify-svg": "svgo --config=.svgo.config.js --quiet --recursive --folder resources/", "test": "npm run lint", "prepare": "husky install", "release": "standard-version",