-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c752daf
commit 98ac88b
Showing
4 changed files
with
1,304 additions
and
3,490 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* SVGO Configuration | ||
* Compatible to v3.0.0+ | ||
* Recommended options from: | ||
* https://www.mediawiki.org/wiki/Manual:Coding_conventions/SVG#Exemplified_safe_configuration | ||
*/ | ||
|
||
'use strict'; | ||
|
||
module.exports = { | ||
plugins: [ | ||
{ | ||
// Set of built-in plugins enabled by default. | ||
name: 'preset-default', | ||
params: { | ||
overrides: { | ||
cleanupIds: false, | ||
removeDesc: false, | ||
removeTitle: false, | ||
removeViewBox: false, | ||
// If the SVG doesn't start with an XML declaration, then its MIME type will | ||
// be detected as "text/plain" rather than "image/svg+xml" by libmagic and, | ||
// consequently, MediaWiki's CSSMin CSS minifier. libmagic's default database | ||
// currently requires that SVGs contain an XML declaration: | ||
// https://github.com/threatstack/libmagic/blob/master/magic/Magdir/sgml#L5 | ||
removeXMLProcInst: false | ||
} | ||
} | ||
}, | ||
'removeRasterImages', | ||
'sortAttrs' | ||
], | ||
// Set whitespace according to Wikimedia Coding Conventions. | ||
// @see https://github.com/svg/svgo/blob/main/lib/stringifier.js#L39 for available options. | ||
js2svg: { | ||
eol: 'lf', | ||
finalNewline: true, | ||
// Configure the indent to tabs (default 4 spaces) used by `--pretty` here. | ||
indent: '\t', | ||
pretty: true | ||
}, | ||
multipass: true | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.