Skip to content

Instantly share code, notes, and snippets.

@mateusvahl
Last active August 29, 2015 14:14
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 mateusvahl/2310fee42ba99941f3e3 to your computer and use it in GitHub Desktop.
Save mateusvahl/2310fee42ba99941f3e3 to your computer and use it in GitHub Desktop.
Gulp + React + Browserify + 6to5
var gulp = require('gulp');
var browserify = require('browserify');
var reactify = require('reactify');
var source = require('vinyl-source-stream');
var to5ify = require('6to5ify');
gulp.task('scripts', function() {
browserify({
insertGlobals: true,
entries: ['./src/index.jsx'],
transform: ['reactify'],
extensions: ['.jsx']
})
.transform(to5ify)
.bundle()
.pipe(source('index.js'))
.pipe(gulp.dest('./dist'));
});
gulp.task('watch', function() {
gulp.watch('./src/index.jsx', ['scripts']);
});
gulp.task('default', ['watch']);
@mateusvahl
Copy link
Author

  "devDependencies": {
    "6to5ify": "^3.1.2",
    "browserify": "^8.1.1",
    "gulp": "^3.8.10",
    "reactify": "^1.0.0",
    "vinyl-source-stream": "^1.0.0"
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment