Skip to content

Instantly share code, notes, and snippets.

@viktor-evdokimov
Created January 21, 2015 14:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viktor-evdokimov/2660587eeac2e362b57a to your computer and use it in GitHub Desktop.
Save viktor-evdokimov/2660587eeac2e362b57a to your computer and use it in GitHub Desktop.
gulp browserify reactify boilerplate gulp file
var gulp = require('gulp')
, browserify = require('browserify')
, concat = require('gulp-concat')
, reactify = require('reactify')
, source = require("vinyl-source-stream")
gulp.task('browserify', function(){
var b = browserify();
b.transform(reactify); // use the reactify transform
b.add('./src/js/main.js');
return b.bundle()
.pipe(source('main.js'))
.pipe(gulp.dest('./dist/js'));
});
gulp.task('copy', function() {
gulp.src('src/index.html')
.pipe(gulp.dest('dist'))
})
gulp.task('default', ['browserify','copy'])
gulp.task('watch', function() {
gulp.watch('src/**/*.*', ['default'])
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment