-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
29 lines (23 loc) · 893 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
const gulp = require('gulp');
const browserify = require('browserify');
const ts = require('gulp-typescript');
const source = require('vinyl-source-stream');
const del = require('del');
const tsProject = ts.createProject('./tsconfig.json');
const clientOutDir = tsProject.options.outDir;
gulp.task('clean', () => {
return del([clientOutDir], { force: true });
});
gulp.task('compile-ts-client', () => {
return tsProject.src()
.pipe(tsProject())
.pipe(gulp.dest(clientOutDir));
});
gulp.task('browserify-client', ['compile-ts-client'], () => {
return browserify(clientOutDir + '/src/Hub.js', {standalone: 'signalR'})
.bundle()
.pipe(source('signalr-client.js'))
.pipe(gulp.dest(clientOutDir + '/browser'));
});
gulp.task('build-ts-client', ['clean', 'compile-ts-client', 'browserify-client']);
gulp.task('default', ['build-ts-client']);