Skip to content

Instantly share code, notes, and snippets.

@heshanlk
Last active October 21, 2016 00:58
Show Gist options
  • Save heshanlk/eda8c75feac3ea8884ceadc453ffca1f to your computer and use it in GitHub Desktop.
Save heshanlk/eda8c75feac3ea8884ceadc453ffca1f to your computer and use it in GitHub Desktop.
Babel + React Gulpfile
const gulp = require('gulp');
const babel = require('gulp-babel');
const browserify = require('browserify');
const source = require('vinyl-source-stream');
const notify = require('gulp-notify');
gulp.task('default', () => {
return browserify({
entries: 'src/CallerBarApp.js',
extensions: ['.jsx'],
debug: true
})
.transform('babelify', {
presets: ['es2015', 'react']
})
.bundle()
.pipe(source('index.js'))
.pipe(gulp.dest('dist'))
.pipe(notify("Bundling done."));
});
gulp.task('watch', function() {
gulp.watch('./src/**/' + "*.js", ['default']);
});
{
"name": "scripts",
"version": "1.0.0",
"description": "A drop of reactivity",
"main": "gulpfile.js",
"private": true,
"author": "Heshan W",
"url": "https://github.com/heshanlk",
"devDependencies": {
"babel-preset-es2015": "^6.9.0",
"babel-preset-react": "^6.5.0",
"gulp": "3.9.1",
"browserify": "13.1.0",
"gulp-babel": "6.1.2",
"vinyl-source-stream": "1.1.0",
"babelify": "7.3.0",
"gulp-notify": "2.2.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment