-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
37 lines (32 loc) · 959 Bytes
/
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
var gulp = require('gulp');
var ts = require('gulp-typescript');
var merge = require('merge2');
var notifier = require('node-notifier');
var sourcemaps = require('gulp-sourcemaps');
var typescript15 = require('typescript');
var tsProjectEmily = ts.createProject({
declarationFiles: true,
noExternalResolve: false,
module: 'commonjs',
target: 'ES5',
noEmitOnError: false,
typescript: typescript15
});
gulp.task('ts', function() {
var tsResult = gulp.src('src/**/*.ts')
.pipe(sourcemaps.init())
.pipe(ts(tsProjectEmily));
tsResult._events.error[0] = function(error) {
notifier.notify({
'title': 'Compilation error',
'message': error.__safety.toString(),
sound: true
});
};
return merge([
tsResult.dts.pipe(gulp.dest('lib/definitions')),
tsResult.js.pipe(gulp.dest('lib/js'))
]);
});
gulp.task('default', ['ts'], function() {
});