Created
May 13, 2015 17:08
-
-
Save esnya/fe9ab1351cbf416207c7 to your computer and use it in GitHub Desktop.
React with gulp
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 react = require('gulp-react'); | |
var browserify = require('browserify'); | |
var source = require('vinyl-source-stream'); | |
var browserfyConfig = { | |
entries: ['./js/index.js'], | |
standalone: 'app' | |
}; | |
gulp.task('lib', function () { | |
return gulp.src('src/*.js') | |
.pipe(react({harmony: true})) | |
.pipe(gulp.dest('js')); | |
}); | |
gulp.task('browserify', ['lib'], function () { | |
return browserify(browserfyConfig) | |
.bundle() | |
.pipe(source('app.js')) | |
.pipe(gulp.dest('./js/')); | |
}); | |
gulp.task('build', ['lib', 'browserify']); | |
gulp.task('default', ['build']); |
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": "sw2", | |
"version": "0.0.0", | |
"description": "nekosheet-sw2", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "MIT", | |
"devDependencies": { | |
"browserify": "^10.1.3", | |
"gulp": "^3.8.11", | |
"gulp-react": "^3.0.1", | |
"vinyl-source-stream": "^1.1.0" | |
}, | |
"dependencies": { | |
"react": "^0.13.3" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment