forked from wcoder/life-calendar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
52 lines (46 loc) · 1.13 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
var gulp = require('gulp');
var runSequence = require('run-sequence');
var clean = require('gulp-clean');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var cssnano = require('gulp-cssnano');
var minifyHTML = require('gulp-minify-html');
gulp.task('default', function() {
// place code for your default task here
});
gulp.task('build', function(callback) {
runSequence(
'build-clean',
'build-js',
'build-css',
'build-html',
callback);
});
gulp.task('build-clean', function() {
return gulp.src('dist').pipe(clean());
});
gulp.task('build-js', function() {
gulp.src([
'src/vendor/jspdf/jspdf.min.js',
'src/vendor/sdate/sdate.js',
'src/js/life-calendar.js',
'src/js/app.js'
])
.pipe(concat('scripts.min.js'))
.pipe(uglify())
.pipe(gulp.dest('dist'))
});
gulp.task('build-css', function() {
return gulp.src([
'src/vendor/bootstrap/css/bootstrap.min.css',
'src/css/main.css'
])
.pipe(concat('styles.min.css'))
.pipe(cssnano())
.pipe(gulp.dest('dist'));
});
gulp.task('build-html', function() {
return gulp.src('src/index.html')
.pipe(minifyHTML({ empty: true }))
.pipe(gulp.dest('dist'));
});