generated from zhonger/jekyll-theme-H2O-ac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
52 lines (46 loc) · 1.5 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'),
concat = require('gulp-concat'), //css
uglify = require('gulp-uglify'), // js
sass = require('gulp-sass')(require('sass')), // sass
cleanCSS = require('gulp-clean-css'), // css
rename = require('gulp-rename');
gulp.task('scripts', (cb) => {
gulp.src('dev/js/index.js')
.pipe(uglify())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('assets/js'));
cb();
});
gulp.task('sass', (cb) => {
gulp.src('dev/sass/app.scss')
.pipe(sass())
.pipe(gulp.dest('dev/sass'))
.pipe(cleanCSS())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('assets/css'));
cb();
});
gulp.task('css', (cb) => {
gulp.src(['dev/sass/github-markdown.css', 'dev/sass/share.min.css'])
.pipe(concat('plugins.min.css'))
.pipe(cleanCSS())
.pipe(gulp.dest('assets/css'));
cb();
});
gulp.task('cv', (cb) => {
gulp.src('dev/sass/cv.scss')
.pipe(sass())
.pipe(gulp.dest('dev/sass'))
.pipe(cleanCSS())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('assets/css'));
cb();
});
gulp.task('watch', function(done) {
gulp.watch('dev/sass/*.scss', gulp.series('sass'));
gulp.watch(['dev/sass/github-markdown.css', 'dev/sass/share.min.css'], gulp.series("css"));
gulp.watch('dev/sass/cv.scss', gulp.series('cv'));
gulp.watch('dev/js/*.js', gulp.series("scripts"));
done();
});
gulp.task('default', gulp.series('scripts', 'sass', 'css', 'cv', 'watch'));