Answer the question
In order to leave comments, you need to log in
Confused with gulp-svg, how to set it up?
I take files from img svg during processing, they end up in img sprite
Structure:
├── assets
│ └── stylus
├── built
│ ├── css
│ ├── fonts
│ ├── img
│ ├── sprite
│ └── svg
gulp.task('svg', function () {
gulp.src('built/img/svg/menu/*.svg')
.pipe(plumber())
.pipe(svgMin())
.pipe(svgSprite({
"shape": {
"spacing": {
"padding": 5,
},
},
"mode": {
"css": {
"dest": '.',
"layout": "diagonal",
"sprite": 'sprite.svg',
"bust": false,
"prefix" : '$',
"dimensions": true,
"render": {
"styl": {
"dest": 'sprite-svg.styl',
}
}
}
}
}))
.pipe(plumber.stop())
.pipe(gulpIf('*.styl', gulp.dest(assets/stylus), gulp.dest(assets/img/sprite)));
});
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