Answer the question
In order to leave comments, you need to log in
Why does svg2png create 400x300 images?
Libraries :
imagemin = require('gulp-imagemin')
+
$ = {
svgSprite : require('gulp-svg-sprite'),
svg2png : require('gulp-svg2png')
}
gulp.task('svgSprite', function() {
return gulp.src('путь до svg/*.svg', {cwd: ''})
.pipe(cache(imagemin({
interlaced: true,
progressive: true,
optimizationLevel: 3,
svgoPlugins: [{removeViewBox: false}]
})))
.pipe($.svgSprite(configSvg))
.on('error', function(error) {
new Elixir.Notification('SVG CRASHED >.<');
})
.pipe(gulp.dest('./'))
.pipe($.svg2png())
.pipe(gulp.dest('resources/assets/'));
});
<svg fill="#000000" height="18" viewBox="0 0 24 24" width="18" xmlns="http://www.w3.org/2000/svg">
<path clip-rule="evenodd" d="M0 0h24v24H0z" fill="none"/>
<path d="M22.7 19l-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4z"/>
</svg>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question