forked from kaeyleo/jekyll-theme-H2O
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
28 lines (24 loc) · 830 Bytes
/
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
var gulp = require('gulp'),
uglify = require('gulp-uglify'), // 压缩js文件
sass = require('gulp-sass'), // 编译sass
cleanCSS = require('gulp-clean-css'), // 压缩css文件
rename = require('gulp-rename'); // 文件重命名
gulp.task('scripts', function(){
gulp.src('dev/js/index.js')
.pipe(uglify())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('assets/js'))
});
gulp.task('sass', function(){
gulp.src('dev/sass/app.scss')
.pipe(sass())
.pipe(gulp.dest('dev/sass'))
.pipe(cleanCSS())
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest('assets/css'));
});
gulp.task('watch', function(){
gulp.watch('dev/sass/*.scss', ['sass']);
gulp.watch('dev/js/*.js', ['scripts']);
});
gulp.task('default', ['scripts', 'sass', 'watch']);