forked from HNUST-CS/angle-street
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
68 lines (60 loc) · 1.7 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// 引入 gulp
var gulp = require('gulp');
// 引入 Plugins
var compass = require('gulp-compass');
var prettify = require('gulp-html-prettify');
var combineCSS = require('combine-css');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
gulp.task('format', function() {
function to(src,dest){
gulp.src(src)
.pipe(prettify({indent_char: ' ', indent_size: 2}))
.pipe(gulp.dest(dest))
}
to('./*.html','./')
to('static/template/*.html','static/template/')
to('static/template/admin/*.html','static/template/admin/')
});
gulp.task('combinelib', function() {
var src=[
"static/js/lib/underscore.js ",
"static/js/lib/jquery.min.js ",
"static/js/lib/angular.min.js ",
"static/js/lib/iScroll.js ",
"static/js/lib/angular-animate.min.js ",
"static/js/lib/angular-route.min.js ",
"static/js/lib/angular-cookies.min.js ",
"static/js/lib/bootstrap.min.js "]
return gulp.src(src)
.pipe(concat("lib.js"))
.pipe(uglify())
.pipe(gulp.dest('static/js/'))
});
gulp.task('combineall',function(cb){
return gulp.src([
"static/js/main.js",
"static/js/config.js ",
])
.pipe(concat('all.js'))
.pipe(gulp.dest('static/js/dest/'))
})
gulp.task('combine',['combinelib','combineall'])
// 创建 Compass 任务
gulp.task('compass', function() {
gulp.src('static/css/*.css')
.pipe(compass({
comments: false,
css: 'css',
}).pipe(gulp.dest('static_min/css')));
});
// 默认任务
gulp.task('default', function() {
// gulp.run('compass');
// gulp.watch([
// './scss/**',
// './img/**'
// ], function(event) {
// gulp.run('compass');
// });
});