forked from nativescript-community/ble
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
44 lines (36 loc) · 1.04 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'),
tsc = require('gulp-typescript'),
sourcemaps = require('gulp-sourcemaps'),
tsProject = tsc.createProject('tsconfig.json');
/**
* Compile TypeScript
*/
gulp.task('typescript', function () {
var sourceTsFiles = ['./**.ts', //path to typescript files
'_references.d.ts']; //reference to library .d.ts files
var tsResult = gulp.src(sourceTsFiles)
.pipe(sourcemaps.init())
.pipe(tsc(tsProject));
tsResult.dts.pipe(gulp.dest('./'));
return tsResult.js
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('./dist'));
});
gulp.task('static', function () {
gulp.src('package.json')
.pipe(gulp.dest('./dist'));
gulp.src('bluetooth.d.ts')
.pipe(gulp.dest('./dist'));
gulp.src('base64.js')
.pipe(gulp.dest('./dist'));
/*gulp.src('bluetooth.android.ts')
.pipe(gulp.dest('./dist'));
gulp.src('bluetooth.ios.ts')
.pipe(gulp.dest('./dist'));
gulp.src('bluetooth-common.ts')
.pipe(gulp.dest('./dist')); */
});
gulp.task('default', [
'typescript',
'static'
]);