Created
March 7, 2015 18:45
-
-
Save mbildner/a57bac34ba2c9623f5c4 to your computer and use it in GitHub Desktop.
starting to play with react
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
'use strict'; | |
var gulp = require('gulp'); | |
var concat = require('gulp-concat'); | |
var react = require('gulp-react'); | |
var DIST_DIR = 'public/dist/'; | |
gulp.task('default', ['build-jsx', 'build-vendor']); | |
gulp.task('build-vendor', function () { | |
return gulp.src([ | |
'node_modules/react/dist/react.js', | |
'node_modules/browser-request/index.js {' | |
]) | |
.pipe(concat('all-vendor.js')) | |
.pipe(gulp.dest(DIST_DIR)); | |
}); | |
gulp.task('build-jsx', function () { | |
return gulp.src('components/**/*') | |
.pipe(react({ | |
harmony: true, | |
stripTypes: true | |
})) | |
.pipe(concat('all-compiled.js')) | |
.pipe(gulp.dest(DIST_DIR)); | |
}); | |
gulp.task('watch', function () { | |
return gulp.watch('components/**/*', ['default']); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment