mirror of
https://github.com/locomotivemtl/locomotive-boilerplate.git
synced 2026-01-15 00:55:08 +08:00
Add NPM script for SVGO with default config
This commit is contained in:
52
build/config/svgo.js
Normal file
52
build/config/svgo.js
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
export default {
|
||||||
|
multipass: true,
|
||||||
|
js2svg: {
|
||||||
|
indent: 4,
|
||||||
|
pretty: true,
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
'cleanupAttrs',
|
||||||
|
'cleanupEnableBackground',
|
||||||
|
'cleanupIDs',
|
||||||
|
'cleanupListOfValues',
|
||||||
|
'cleanupNumericValues',
|
||||||
|
'collapseGroups',
|
||||||
|
'convertColors',
|
||||||
|
'convertEllipseToCircle',
|
||||||
|
'convertPathData',
|
||||||
|
'convertShapeToPath',
|
||||||
|
'convertStyleToAttrs',
|
||||||
|
'convertTransform',
|
||||||
|
'inlineStyles',
|
||||||
|
'mergePaths',
|
||||||
|
'mergeStyles',
|
||||||
|
'minifyStyles',
|
||||||
|
'moveElemsAttrsToGroup',
|
||||||
|
'moveGroupAttrsToElems',
|
||||||
|
'removeComments',
|
||||||
|
'removeDesc',
|
||||||
|
'removeDimensions',
|
||||||
|
'removeDoctype',
|
||||||
|
'removeEditorsNSData',
|
||||||
|
'removeEmptyAttrs',
|
||||||
|
'removeEmptyContainers',
|
||||||
|
'removeEmptyText',
|
||||||
|
'removeHiddenElems',
|
||||||
|
'removeMetadata',
|
||||||
|
'removeNonInheritableGroupAttrs',
|
||||||
|
'removeRasterImages',
|
||||||
|
'removeScriptElement',
|
||||||
|
'removeStyleElement',
|
||||||
|
'removeTitle',
|
||||||
|
'removeUnknownsAndDefaults',
|
||||||
|
'removeUnusedNS',
|
||||||
|
'removeUselessDefs',
|
||||||
|
'removeUselessStrokeAndFill',
|
||||||
|
'removeViewBox',
|
||||||
|
// 'removeXMLNS',
|
||||||
|
// 'removeXMLProcInst',
|
||||||
|
// 'reusePaths',
|
||||||
|
// 'sortAttrs',
|
||||||
|
'sortDefsChildren',
|
||||||
|
],
|
||||||
|
}
|
||||||
@@ -11,7 +11,8 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node --experimental-json-modules --no-warnings build/watch.js",
|
"start": "node --experimental-json-modules --no-warnings build/watch.js",
|
||||||
"build": "node --experimental-json-modules --no-warnings build/build.js"
|
"build": "node --experimental-json-modules --no-warnings build/build.js",
|
||||||
|
"optimize:svg": "svgo --config=build/config/svgo.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"locomotive-scroll": "^5.0.0-beta.11",
|
"locomotive-scroll": "^5.0.0-beta.11",
|
||||||
|
|||||||
Reference in New Issue
Block a user