-
-
Save sdmgeek/72d0fe3983ca3391e36a399d7d94f4c0 to your computer and use it in GitHub Desktop.
npm, gulp, browserify setting for react using babel
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
| var gulp = require('gulp'); | |
| var browserify = require('browserify'); | |
| var babelify = require('babelify'); | |
| var source = require('vinyl-source-stream'); | |
| gulp.task('browserify', function() { | |
| return browserify('./js/app.js').transform(babelify, {presets: ["es2015", "react"]}) | |
| .bundle() | |
| .pipe(source('bundle.js')) | |
| .pipe(gulp.dest('js')); | |
| }); | |
| gulp.task('watch', function() { | |
| gulp.watch('**/*.js', ['browserify']); | |
| }); |
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
| { | |
| "devDependencies": { | |
| "babel-preset-es2015": "^6.9.0", | |
| "babel-preset-react": "^6.5.0", | |
| "babelify": "^7.3.0", | |
| "browserify": "^13.0.1", | |
| "gulp": "^3.9.1", | |
| "vinyl-source-stream": "^1.1.0" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment