3 * Recommended options from:
4 * https://www.mediawiki.org/wiki/Manual:Coding_conventions/SVG#Exemplified_safe_configuration
6 const { extendDefaultPlugins } = require( 'svgo' );
9 plugins: extendDefaultPlugins( [
19 name: 'removeRasterImages',
27 name: 'removeViewBox',
31 // If the SVG doesn't start with an XML declaration, then its MIME type will
32 // be detected as "text/plain" rather than "image/svg+xml" by libmagic and,
33 // consequently, MediaWiki's CSSMin CSS minifier. libmagic's default database
34 // currently requires that SVGs contain an XML declaration:
35 // https://github.com/threatstack/libmagic/blob/master/magic/Magdir/sgml#L5
36 name: 'removeXMLProcInst',
45 // Configure the indent (default 4 spaces) used by `--pretty` here:
46 // @see https://github.com/svg/svgo/blob/master/lib/svgo/js2svg.js#L6 for more config options
48 // Unfortunately EOL cannot be configured, SVGO uses the platform's EOL marker.
49 // On non-unix systems the linebreaks will be normalized to LF (unix) only at git commit,
50 // assuming `core.autocrlf` is 'true' (default) or 'input'.