-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgulpfile.js
More file actions
40 lines (34 loc) · 1.03 KB
/
gulpfile.js
File metadata and controls
40 lines (34 loc) · 1.03 KB
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
var gulp = require('gulp');
var tsb = require('gulp-tsb');
var notifier = require('node-notifier');
// create and keep compiler
var compilation = tsb.create({
target: 'es3',
module: 'commonjs',
declaration: true,
moduleResolution: 'node',
types: ["node"],
lib: ["es2015", "es2015.promise", "es5"],
});
// Set up src ts build task
gulp.task("srcCompileTS", function () {
return gulp.src('*.ts')
.pipe(compilation()) // <- compilation
.pipe(gulp.dest('./src/'));
});
gulp.task("srcCompileJS", ["srcCompileTS"], function () {
});
gulp.task('notifySRCComplete', ['srcCompileJS'], function () {
notifier.notify({
'title': 'Javascript',
'message': 'SRC Compilation done!'
});
});
// Set up watch task
gulp.task('default', ['srcCompileTS', 'srcCompileJS', 'notifySRCComplete'], function () {
// SRC files watch
gulp.watch('*.ts', ['srcCompileTS', 'srcCompileJS', 'notifySRCComplete'], function () {
// Run srcCompileTS
console.log("Src TS Watch fired!");
});
});