mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-19 15:31:36 +03:00
45 lines
1.4 KiB
JavaScript
45 lines
1.4 KiB
JavaScript
const svgo = require('svgo');
|
|
|
|
module.exports = {
|
|
optimize(input, removeAttrs) {
|
|
return svgo.optimize(input, {
|
|
plugins: [
|
|
'cleanupAttrs',
|
|
'removeDoctype',
|
|
'removeXMLProcInst',
|
|
'removeComments',
|
|
'removeMetadata',
|
|
'removeTitle',
|
|
'removeDesc',
|
|
'removeUselessDefs',
|
|
'removeEditorsNSData',
|
|
'removeEmptyAttrs',
|
|
'removeHiddenElems',
|
|
'removeEmptyText',
|
|
'removeEmptyContainers',
|
|
'removeViewBox',
|
|
'cleanupEnableBackground',
|
|
'convertStyleToAttrs',
|
|
'convertColors',
|
|
'convertPathData',
|
|
'convertTransform',
|
|
'removeUnknownsAndDefaults',
|
|
'removeNonInheritableGroupAttrs',
|
|
'removeUselessStrokeAndFill',
|
|
'removeUnusedNS',
|
|
'cleanupIDs',
|
|
'cleanupNumericValues',
|
|
'moveElemsAttrsToGroup',
|
|
'moveGroupAttrsToElems',
|
|
'collapseGroups',
|
|
'removeRasterImages',
|
|
'mergePaths',
|
|
'convertShapeToPath',
|
|
'sortAttrs',
|
|
'removeDimensions',
|
|
removeAttrs,
|
|
],
|
|
});
|
|
},
|
|
};
|