-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
33 lines (27 loc) · 868 Bytes
/
Copy pathgulpfile.js
File metadata and controls
33 lines (27 loc) · 868 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
29
30
31
32
33
var gulp = require('gulp'),
babel = require('gulp-babel'),
webpack = require('webpack-stream');
gulp.task('server', function() {
require('./test/server');
});
gulp.task('babel', function() {
return gulp.src('./src/**/*.js')
.pipe(babel({
presets: ['es2015', 'stage-0', 'react']
}))
.pipe(gulp.dest('lib'));
});
gulp.task('babel:watch', function() {
gulp.watch('src/**/*.js', ['babel', 'webpack']);
});
gulp.task('webpack', function() {
return gulp.src('./test/client.js')
.pipe(webpack(require('./test/webpack.config')))
.pipe(gulp.dest(__dirname));
});
gulp.task('webpack:watch', function() {
gulp.watch(['test/**/*.js', '!test/public/**'], ['webpack']);
});
gulp.task('build', ['babel']);
gulp.task('build-test', ['webpack']);
gulp.task('development', ['build', 'build-test', 'babel:watch', 'webpack:watch', 'server']);