-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
31 lines (26 loc) · 867 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
const gulp = require('gulp');
const ts = require('gulp-typescript');
const webpack = require('webpack-stream');
gulp.task('common', () => {
return gulp.src('common/**/*.ts')
.pipe(ts())
.pipe(gulp.dest('common'));
});
gulp.task('browser-client', ['common'], () => {
return gulp.src(['browser-client/*.tsx', 'browser-client/*.ts'])
.pipe(ts(require('./tsconfig').compilerOptions))
.pipe(gulp.dest('browser-client'));
});
gulp.task('browser-bundled', ['browser-client'], () => {
return gulp.src('browser-client/app.js')
.pipe(webpack({
output: {
filename: 'bundled.js'
}
}))
.pipe(gulp.dest('browser-client/public'));
})
gulp.task('watch', ['default'], () => {
gulp.watch(['common/**/*.ts', 'browser-client/*.tsx', 'browser-client/*.ts'], ['browser-bundled']);
});
gulp.task('default', ['browser-bundled']);