-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
38 lines (34 loc) · 1.03 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
var gulp = require('gulp');
var tmod = require('gulp-tmod');
var browserify = require('gulp-browserify');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var jquery = require('jquery');
gulp.task('tmod-tpl',function() {
var stream = gulp.src('./www/tpls/*.html')
.pipe(tmod({
type:'default',
templateBase:'./www/tpls'
}))
// .pipe(uglify())
.pipe(gulp.dest('./www/build'));
return stream;
})
gulp.task('index',['tmod-tpl'],function() {
return gulp.src('./www/js/index.js')
.pipe(browserify())
.pipe(uglify())
.pipe(concat('all.min.js'))
.pipe(gulp.dest('./www/build'));
})
//gulp.task('ug-all',function() {
// console.log('start concat all');
// return gulp.src(['./libs/jquery.min.js','./libs/libs/light7.min.js','./www/build/all.min.js'])
// .pipe(browserify())
// .pipe(concat('main.min.js'))
// .pipe(gulp.dest('./www/build'))
//})
gulp.task('default',['index'],function() {
console.log('finish........');
});
gulp.watch(['./www/js/**/*.js','./www/tpls/*.html'],['index']);