-
Notifications
You must be signed in to change notification settings - Fork 24
/
Gulpfile.js
36 lines (30 loc) · 838 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
'use-strict';
//////////////////////////////
// Requires
//////////////////////////////
var gulp = require('gulp');
var svgSprite = require('gulp-svg-sprite');
// SVG Config
var config = {
mode: {
symbol: { // symbol mode to build the SVG
dest: 'sprite', // destination foldeer
sprite: 'sprite.svg', //sprite name
example: true // Build sample page
}
},
svg: {
xmlDeclaration: false, // strip out the XML attribute
doctypeDeclaration: false // don't include the !DOCTYPE declaration
}
};
gulp.task('sprite-page', function() {
return gulp.src('svg/**/*.svg')
.pipe(svgSprite(config))
.pipe(gulp.dest('.'));
});
gulp.task('sprite-shortcut', function() {
return gulp.src('sprite/sprite.svg')
.pipe(gulp.dest('.'));
});
gulp.task('default', ['sprite-page', 'sprite-shortcut']);