rollup-plugin-svg-slim
v1.0.0
Published
The loader plugin of rollup, reads svg files and compresses them with svg-slim
Downloads
3
Readme
rollup-plugin-svg-slim
rollup plug-in, read the svg file and use svg-slim to compress
Installation
npm install rollup-plugin-svg-slim -D
or
yarn add rollup-plugin-svg-slim -D
Configuration
The following is the schematic code in rollup.config.js
Use default configuration
import svgs from 'rollup-plugin-svg-slim';
export default ({
...
plugins: [svgs()],
...
});
Custom configuration
For custom configuration, please refer to the documentation of svg-slim
import svgs from 'rollup-plugin-svg-slim';
export default ({
...
plugins: [
svgs({
rules: {
'shorten-decimal-digits': false,
'shorten-id': false,
},
params: {
sizeDigit: 2,
angelDigit: 2,
},
}),
],
...
});