-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
73 lines (59 loc) · 1.64 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
73
var gulp = require('gulp');
var tsc = require('gulp-tsc');
var shell = require('gulp-shell');
var runseq = require('run-sequence');
var tslint = require('gulp-tslint');
var browserify = require('gulp-browserify')
var rimraf = require('rimraf');
var paths = {
tscripts : { src : ['app/src/**/*.ts'],
dest : 'app/build/tmp'
},
nodescripts: {
src : ['app/build/tmp/vsshare-client.js'],
dest: 'app/build'
}
};
gulp.task('default', ['lint', 'build']);
// ** Watching ** //
gulp.task('watch', function () {
gulp.watch(paths.tscripts.src, ['compile:typescript']);
});
gulp.task('watchrun', function () {
gulp.watch(paths.tscripts.src, runseq('compile:typescript', 'run'));
});
// ** Compilation ** //
gulp.task('build', function(callback){
runseq('compile:typescript', 'browserify', callback);
});
var exec_tsc = function () {
return gulp
.src(paths.tscripts.src)
.pipe(tsc({
module: "commonjs",
emitError: false
}))
.pipe(gulp.dest(paths.tscripts.dest));
};
gulp.task('compile:typescript', exec_tsc);
var exec_clean = function (cb) {
rimraf(paths.nodescripts.dest, cb);
};
gulp.task('clean', exec_clean);
var exec_browserify = function(){
return gulp
.src(paths.nodescripts.src)
.pipe(browserify())
.pipe(gulp.dest(paths.nodescripts.dest))
.pipe(gulp.dest("D:/Users/oboenikui/Documents/git/web_debugger/js"));
};
gulp.task('browserify', exec_browserify);
// ** Linting ** //
gulp.task('lint', ['lint:default']);
gulp.task('lint:default', function(){
return gulp.src(paths.tscripts.src)
.pipe(tslint())
.pipe(tslint.report('prose', {
emitError: false
}));
});