Skip to content

Instantly share code, notes, and snippets.

@outofambit
Last active March 18, 2016 01:02
Show Gist options
  • Save outofambit/5fe36a645b999174fce5 to your computer and use it in GitHub Desktop.
Save outofambit/5fe36a645b999174fce5 to your computer and use it in GitHub Desktop.
React.js Getting Started Gulp Example
var gulp = require('gulp')
var browserify = require('browserify')
var babelify = require('babelify')
var source = require('vinyl-source-stream')
gulp.task('build', () => {
// our js lives in main.js, so its our source
var b = browserify('main.js')
b.transform(babelify, {presets: ['es2015', 'react']})
// the output will be called bundle.js and it will be put in the public folder
return b.bundle().pipe(source('bundle.js')).pipe(gulp.dest('public'))
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment