Scale svg size;
npm install svg-scaler
ands
var svgscaler = require('svg-scaler');
gulp.src('src/*.svg')
.pipe(svgscaler({ width: number })) // options
.pipe(gulp.dest('./dest/svg/'))
type:boolean
, default is false
, if you want remain more detail, please set it true
;
type:number
, will make the svg scale to the size by the number, will fix to square, unity all svg files to same size.
type:number
, just normal scale
, but if have the width or the height option, the scale
will not work.
- not support image in svg.
- because use phantom, so need some special configuration. please see the
Gruntfile
, same for gulp.