-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
40 lines (34 loc) · 1.01 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
var gulp = require('gulp'),
rename = require('gulp-rename'),
minifyCSS = require('gulp-clean-css'),
minify = require('gulp-minify'),
del = require('del'),
wrap = require('gulp-wrap'),
compass = require('gulp-compass');
gulp.task('compass', function() {
return gulp.src('src/scss/sap.scss')
.pipe(compass({
css: 'tmp',
sass: 'src/scss/',
}));
});
gulp.task('minify-css', function(){
return gulp.src('tmp/sap.css')
.pipe(minifyCSS({processImport: false}))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('dist'));
});
gulp.task('compress', function(){
return gulp.src('src/js/sap.js')
.pipe(wrap('(function($){ <%= contents %> })(jQuery);'))
.pipe(minify())
.pipe(gulp.dest('dist'));
});
gulp.task('copy-html', function(){
return gulp.src('src/html/sap.html')
.pipe(gulp.dest('dist'));
});
gulp.task('clean', function(cb) {
return del('tmp', cb);
});
gulp.task('build', gulp.series('compass', 'copy-html', 'minify-css', 'compress', 'clean'));