Skip to content

Instantly share code, notes, and snippets.

@sdmgeek
Forked from JeffreyWay/Gulpfile.js
Last active June 13, 2016 18:37
Show Gist options
  • Select an option

  • Save sdmgeek/72d0fe3983ca3391e36a399d7d94f4c0 to your computer and use it in GitHub Desktop.

Select an option

Save sdmgeek/72d0fe3983ca3391e36a399d7d94f4c0 to your computer and use it in GitHub Desktop.
npm, gulp, browserify setting for react using babel
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, {presets: ["es2015", "react"]})
.bundle()
.pipe(source('bundle.js'))
.pipe(gulp.dest('js'));
});
gulp.task('watch', function() {
gulp.watch('**/*.js', ['browserify']);
});
{
"devDependencies": {
"babel-preset-es2015": "^6.9.0",
"babel-preset-react": "^6.5.0",
"babelify": "^7.3.0",
"browserify": "^13.0.1",
"gulp": "^3.9.1",
"vinyl-source-stream": "^1.1.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment