-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgulpfile.js
More file actions
33 lines (30 loc) · 845 Bytes
/
Copy pathgulpfile.js
File metadata and controls
33 lines (30 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const gulp = require('gulp');
const svgmin = require('gulp-svgmin');
const svgSprite = require('gulp-svg-sprite');
const runSequence = require('run-sequence');
const del = require('del');
gulp.task('clean', function() {
return del(['src/assets/icons/symbol']);
});
gulp.task('icons', function() {
return gulp
.src('src/assets/icons/**/*')
.pipe(
svgmin({
plugins: [{removeTitle: true}, {removeDesc: {removeAny: true}}],
}),
)
.pipe(
svgSprite({
mode: {
symbol: {
sprite: 'sprite',
},
},
}),
)
.pipe(gulp.dest('src/assets/icons'));
});
gulp.task('default', function(callback) {
runSequence('clean', 'icons', callback);
});