-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgulpfile.js
More file actions
28 lines (24 loc) · 761 Bytes
/
Copy pathgulpfile.js
File metadata and controls
28 lines (24 loc) · 761 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
27
28
var gulp = require('gulp');
var babel = require('gulp-babel');
var browserify = require('gulp-browserify');
var reactify = require('reactify');
var rename = require('gulp-rename');
gulp.task('babel', function () {
gulp.src('weiqi/src/**/*.js')
.pipe(babel())
.pipe(gulp.dest('weiqi/dist'));
});
gulp.task('jsx', ['babel'], function () {
gulp.src('src/app.jsx', {read: false})
.pipe(browserify({
transform: ['reactify'],
extensions: ['.jsx']
}))
.pipe(rename('app.js'))
.pipe(gulp.dest('./dist'))
});
gulp.task('watch', function () {
gulp.watch(['src/**/*'], ['jsx']);
gulp.watch(['weiqi/src/**/*'], ['babel','jsx']);
});
gulp.task('default', ['watch', 'babel', 'jsx']);