-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
41 lines (39 loc) · 843 Bytes
/
gulpfile.js
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
34
35
36
37
38
39
40
41
let gulp = require('gulp'),
svgSprite = require('gulp-svg-sprite')
gulp.task('svgToSprite', () => {
let config = {
log: 'verbose',
shape: {
id: {
separator: '-',
},
transform: [
{
svgo: {
plugins: [
{
cleanupListOfValues: {
floatPrecision: 1,
},
},
{ removeXMLNS: true },
{ removeTitle: false },
],
},
},
],
},
mode: {
symbol: {
dest: '.',
sprite: 'sprite.svg',
},
},
}
return gulp
.src('**/*.svg', { cwd: 'src/assets' })
.pipe(svgSprite(config))
.pipe(gulp.dest('src/assets'))
})
gulp.task('build', gulp.series('svgToSprite'))
gulp.task('default', gulp.task('svgToSprite'))