forked from brandonmowat/react-chat-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
26 lines (22 loc) · 785 Bytes
/
gulpfile.js
File metadata and controls
26 lines (22 loc) · 785 Bytes
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
const gulp = require('gulp');
const babel = require('gulp-babel');
const plumber = require('gulp-plumber');
const ts = require('gulp-typescript');
const project = ts.createProject('tsconfig.json');
// Compile all necessary files to "lib" directory
gulp.task('compileTS', () => {
const result = gulp.src('src/**/*{ts,tsx}').pipe(project());
return result.js.pipe(gulp.dest('temp'));
});
gulp.task('compileRCT', () => {
gulp
.src(['temp/**/*.js', 'index.js'])
.pipe(plumber())
.pipe(babel({ presets: ['es2015', 'stage-0', 'react'] }))
.pipe(gulp.dest('lib'));
});
// configure which files to watch and what tasks to use on file changes
gulp.task('watch', () => {
gulp.watch('src/**/*{ts,tsx}', ['compileTS']);
gulp.watch('temp/**/*js', ['compileRCT']);
});