-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
49 lines (43 loc) · 1.02 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
var gulp = require('gulp');
var ts = require('gulp-typescript');
var gulpFilter = require('gulp-filter');
var rimraf = require('gulp-rimraf');
var runSequence = require('run-sequence');
var rename = require("gulp-rename");
gulp.task('default', function(done) {
runSequence(
"clean",
"compile",
done);
});
gulp.task('clean', function () {
return gulp.src([
'lib/**/*.js',
'lib/**/*.d.ts',
], { read: false })
.pipe(rimraf({ force: true }));
});
gulp.task('compile', function () {
var compiler = ts({
declarationFiles: true,
noExternalResolve: false,
module: 'commonjs',
target: 'ES5',
noImplicitAny: true,
noLib: false,
outDir: 'lib',
});
var result = gulp
.src([
'src/**/*.ts',
'typings/**/*.d.ts'
])
.pipe(compiler)
;
result.dts
.pipe(gulp.dest('lib'))
;
return result.js
.pipe(gulp.dest('lib'))
;
});