svg-slim is an SVG compression tool that provides rich customization and follows the W3C SVG specification
npm install svg-slim
or
yarn add svg-slim
import svgSlim from 'svg-slim';
svgSlim(svgcode[, config]).then(result => {
console.log(result);
});
Where svgcode is svg text in string format and config is user-defined optimized configuration
View the main item optimized configuration
svg-slim-loader is a loader plugin for webpack, which supports optimization of imported SVG files
postcss-svg-slim is a plugin for postcss that supports optimizing inline SVG in CSS
rollup-plugin-svg-slim is a rollup plugin that supports SVG optimization in rollup
- Rich and powerful functions, enough personalized configuration parameters
- Pursue the ultimate optimization effect
- Try not to destroy the original svg effect
- Follow the latest svg specifications
If you think this project is helpful to you, sponsors are welcome.