Skip to content

benboba/svg-slim

Repository files navigation

svg-slim

npm version

中文版

Change Log

View change log

Introduction

svg-slim is an SVG compression tool that provides rich customization and follows the W3C SVG specification

Installation

npm install svg-slim

or

yarn add svg-slim

Use

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

Optimized Configuration

View the main item optimized configuration

Use online

svg-slim-web

Use svg-slim-loader

svg-slim-loader is a loader plugin for webpack, which supports optimization of imported SVG files

Use postcss-svg-slim

postcss-svg-slim is a plugin for postcss that supports optimizing inline SVG in CSS

Use rollup-plugin-svg-slim

rollup-plugin-svg-slim is a rollup plugin that supports SVG optimization in rollup

Why choose svg-slim?

  • 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

Sponsor the developer

If you think this project is helpful to you, sponsors are welcome.