-
Notifications
You must be signed in to change notification settings - Fork 36
/
gulpfile.js
54 lines (46 loc) · 1.11 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
var gulp = require('gulp');
var plugins = require('gulp-load-plugins')();
var del = require('del');
var path = {
assets: 'pe-icon-7-stroke',
get sass() {
return this.assets + '/scss'
},
get css() {
return this.assets + '/css'
},
get dist() {
return this.assets + '/dist'
}
};
var fontName = 'pe-icon-7-stroke';
gulp.task('clean', function(cb) {
del([path.dist], cb);
});
gulp.task('sass', function() {
return gulp.src(path.sass + '/' + fontName + '.scss')
.pipe(plugins.plumber())
.pipe(plugins.sass())
.pipe(plugins.autoprefixer(
[ 'last 15 versions', '> 1%', 'ie 8', 'ie 7' ],
{ cascade: true }
))
.pipe(gulp.dest(path.dist));
});
gulp.task('minify-css', ['sass'], function() {
return gulp.src(path.dist + '/' + fontName + '.css')
.pipe(plugins.plumber())
.pipe(plugins.rename({ suffix: '.min'} ))
.pipe(plugins.minifyCss())
.pipe(gulp.dest(path.dist));
});
gulp.task('build', ['sass', 'minify-css'], function() {
});
gulp.task('watch', function() {
gulp.watch(
[path.sass + '/*.scss'],
['sass']
);
});
gulp.task('default', ['build'], function() {
});