-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathgulpfile.js
49 lines (43 loc) · 1 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
const gulp = require('gulp');
const clean = require('gulp-clean');
const concat = require('gulp-concat');
const uglify = require('gulp-uglify');
const cleanCSS = require('gulp-clean-css');
const htmlmin = require('gulp-htmlmin');
gulp.task('clean', () => {
return gulp.src('dist').pipe(clean());
});
gulp.task('scripts', () => {
return 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('styles', () => {
return gulp.src([
'src/vendor/bootstrap/css/bootstrap.min.css',
'src/css/main.css'
])
.pipe(concat('styles.min.css'))
.pipe(cleanCSS())
.pipe(gulp.dest('dist'));
});
gulp.task('html', () => {
return gulp.src('src/index.html')
.pipe(htmlmin({ collapseWhitespace: true }))
.pipe(gulp.dest('dist'));
});
gulp.task('build',
gulp.series(
'clean',
'scripts',
'styles',
'html',
)
);
gulp.task('default', gulp.series('build'));