Last active
March 20, 2016 20:35
-
-
Save Radostin/f980358e65f3af82e051 to your computer and use it in GitHub Desktop.
bundling reactjs components with Gulp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var browserify = require('browserify'); | |
var babelify = require('babelify'); | |
var source = require('vinyl-source-stream'); | |
gulp.task('browserify', function () { | |
return browserify('./js/app.js') | |
.transform(babelify, {stage: 0}) | |
.bundle() | |
.pipe(source('bundle.js')) | |
.pipe(gulp.dest('js')); | |
}); | |
gulp.task('watch', function () { | |
gulp.watch('**/*.js', ['browserify']); | |
gulp.watch('**/*/*.js', ['browserify']); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment