This repository has been archived by the owner on Jan 12, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 84
/
Copy pathgulpfile.js
72 lines (59 loc) · 1.78 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
68
69
70
71
72
var fs = require('fs')
gulp = require("gulp"),
del = require('del'),
babel = require('gulp-babel'),
rename = require('gulp-rename'),
concat = require('gulp-concat'),
browserify = require("browserify"),
source = require('vinyl-source-stream'),
path = require('path'),
less = require('gulp-less'),
wrap = require('gulp-wrap');
gulp.task('clean', function() {
del.sync(['build/*']);
return del.sync(['bin/*']);
});
// gulp.task('dump',['clean'],function(callback){
// gulp.src("vendor/**/*")
// .pipe(gulp.dest('./build/vendor'));
// return callback()
// });
gulp.task('babel',['clean'],function(){
return gulp.src('src/**/*.js')
.pipe(babel({
presets: ['stage-0','es2015'],
plugins: ['transform-runtime']
}))
.pipe(gulp.dest('./build'));
})
gulp.task('weex-buildtool',['babel'],function(){
return gulp.src('./build/index.js')
.pipe(wrap("#!/usr/bin/env node --harmony_proxies\n\n<%= contents %>"))
.pipe(gulp.dest('./bin'))
})
// gulp.task('browserify',['babel'],function(callback){
// browserify("./build/debugger-client.js", { debug: false })
// .bundle()
// .pipe(source('debugger-client-browserify.js')) //vinyl-source-stream
// .pipe(gulp.dest('./build/'))
// return callback()
// })
// gulp.task('less',function(callback){
// gulp.src('./src/css/**/*.less')
// .pipe(less({
// paths: [ path.join(__dirname, 'src/css/', 'includes') ]
// }))
// .pipe(gulp.dest('./build/css'));
//
// gulp.src('./src/css/**/*.css')
// .pipe(gulp.dest('./build/css'));
//
// return callback()
// })
gulp.task('build',['weex-buildtool'],function(cb){
return cb()
})
gulp.task('watch',function(){
gulp.watch('src/**/*.js',['build']);
});
gulp.task('default',['build']);