Answer the question
In order to leave comments, you need to log in
Overwrite Gulp file?
There is a task that generates Sprites, but each time it is called, not only new pictures are added to the existing sprite, but in general everything that is in the folder (i.e. pictures are duplicated). How can I delete a sprite each time so that it is generated from scratch or somehow not duplicate pictures?
gulp.task('sprite', function () {
let spriteData = gulp.src('src/assets/img/sprite/*.*').pipe(spritesmith({
imgName: 'sprite.png',
imgPath: '../img/sprite/sprite.png',
cssName: '../../css/sprite.scss',
algorithm: 'binary-tree',
padding: 5,
cssFormat: 'scss'
}));
return spriteData.pipe(gulp.dest('src/assets/img/sprite/'));
});
Answer the question
In order to leave comments, you need to log in
'src/assets/img/sprite/*.*'
- that's why everyone is taken. Take only what you need
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question