-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgulpfile.js
More file actions
31 lines (28 loc) · 783 Bytes
/
gulpfile.js
File metadata and controls
31 lines (28 loc) · 783 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
var gulp = require('gulp');
var browserify = require('gulp-browserify');
var concat = require('gulp-concat');
var path = require('path');
var plumber = require('gulp-plumber')
var gutil = require('gulp-util')
var reactify = require('reactify')
var onError = function (err) {
gutil.beep();
gutil.log(gutil.colors.red(err.message))
gutil.log(err)
};
// Builds the scripts based on a single entry point using browserify
gulp.task('scripts', function() {
return gulp.src(['./react-swipe.jsx'])
.pipe(plumber({
errorHandler: onError
}))
.pipe(browserify({
insertGlobals: true,
transform: 'reactify'
}))
.pipe(concat('bundle.js'))
.pipe(gulp.dest('./'))
});
gulp.task('default', function() {
gulp.watch(['**.jsx'],['scripts']);
});