Last active
October 21, 2016 00:58
-
-
Save heshanlk/eda8c75feac3ea8884ceadc453ffca1f to your computer and use it in GitHub Desktop.
Babel + React Gulpfile
This file contains hidden or 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
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']); | |
}); |
This file contains hidden or 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
{ | |
"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