build: Update 'svgo' to latest v2.8.0
Updating 'svgo' to v2.8.0 and newest Wikimedia SVG guidelines – mainly around new whitespace features of SVGO. Change-Id: I4a9b0efb9fe8d4648a4d218397cf3d9548552421isekai
parent
e4c58084bf
commit
91c3bb0f61
@ -1,55 +1,40 @@
|
||||
/**
|
||||
* SVGO Configuration
|
||||
* Compatible to v2.4.0+
|
||||
* Recommended options from:
|
||||
* https://www.mediawiki.org/wiki/Manual:Coding_conventions/SVG#Exemplified_safe_configuration
|
||||
*/
|
||||
const { extendDefaultPlugins } = require( 'svgo' );
|
||||
module.exports = {
|
||||
multipass: true,
|
||||
plugins: extendDefaultPlugins( [
|
||||
{
|
||||
name: 'cleanupIDs',
|
||||
active: false
|
||||
},
|
||||
{
|
||||
name: 'removeDesc',
|
||||
active: false
|
||||
},
|
||||
{
|
||||
name: 'removeRasterImages',
|
||||
active: true
|
||||
},
|
||||
{
|
||||
name: 'removeTitle',
|
||||
active: false
|
||||
},
|
||||
{
|
||||
name: 'removeViewBox',
|
||||
active: false
|
||||
},
|
||||
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
|
||||
name: 'removeXMLProcInst',
|
||||
active: false
|
||||
},
|
||||
{
|
||||
name: 'sortAttrs',
|
||||
active: true
|
||||
removeXMLProcInst: false
|
||||
}
|
||||
] ),
|
||||
|
||||
// Configure the indent (default 4 spaces) used by `--pretty` here:
|
||||
// @see https://github.com/svg/svgo/blob/master/lib/svgo/js2svg.js#L6 for more config options
|
||||
//
|
||||
// Unfortunately EOL cannot be configured, SVGO uses the platform's EOL marker.
|
||||
// On non-unix systems the linebreaks will be normalized to LF (unix) only at git commit,
|
||||
// assuming `core.autocrlf` is 'true' (default) or 'input'.
|
||||
js2svg: {
|
||||
indent: "\t",
|
||||
pretty: true,
|
||||
}
|
||||
}
|
||||
},
|
||||
'removeRasterImages',
|
||||
'sortAttrs'
|
||||
],
|
||||
// Set whitespace according to Wikimedia Coding Conventions.
|
||||
// @see https://github.com/svg/svgo/blob/main/lib/svgo/coa.js#L194 for more config options
|
||||
js2svg: {
|
||||
eol: 'lf',
|
||||
finalNewline: true,
|
||||
// Configure the indent to tabs (default 4 spaces) used by `--pretty` here.
|
||||
indent: '\t',
|
||||
pretty: true
|
||||
},
|
||||
multipass: true
|
||||
};
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue