-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
44 lines (38 loc) · 1.03 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
var gulp = require('gulp');
var runSequence = require('run-sequence');
var del = require('del');
var ts = require('gulp-typescript');
var jest = require('gulp-jest').default;
gulp.task('build', function(done) {
runSequence('build-src', 'build-dts', done);
});
var sourcesTemplate = 'src/**/*.tsx';
var packageOutDir = 'dist';
gulp.task('build-src', function() {
return gulp.src(sourcesTemplate)
.pipe(ts.createProject('tsconfig.json')())
.pipe(gulp.dest(packageOutDir));
});
gulp.task("build-dts", function() {
return gulp.src(sourcesTemplate)
.pipe(ts.createProject("tsconfig.json", {
declaration: true,
noResolve: false
})())
.pipe(gulp.dest(packageOutDir));
});
gulp.task("clean", function() {
return del([
packageOutDir
]);
});
gulp.task('jest', function () {
return gulp.src('tests').pipe(jest({
config: {
"preprocessorIgnorePatterns": [
"<rootDir>/dist/", "<rootDir>/node_modules/"
],
"automock": false
}
}));
});