Last active
March 18, 2016 01:02
-
-
Save outofambit/5fe36a645b999174fce5 to your computer and use it in GitHub Desktop.
React.js Getting Started Gulp Example
This file contains 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('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