Skip to content

Commit

Permalink
Merge pull request facebook#19 from zpao/gulp
Browse files Browse the repository at this point in the history
Use Gulp for build process instead of make
  • Loading branch information
fisherwebdev committed Aug 8, 2014
2 parents 040bf95 + a7fcd76 commit 045312b
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 19 deletions.
35 changes: 35 additions & 0 deletions Gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
var gulp = require('gulp');
var gRimraf = require('gulp-rimraf');
var gReact = require('gulp-react')
var gReplace = require('gulp-replace');
var browserify = require('browserify');
var source = require('vinyl-source-stream');

var browserifyConfig = {
entries: ['./index.js'],
standalone: 'Flux'
};

gulp.task('clean', function() {
return gulp.src(['lib/', 'Flux.js'], { read: false })
.pipe(gRimraf());
});

gulp.task('lib', function() {
return gulp.src('src/*.js')
.pipe(gReact({harmony: true}))
.pipe(gReplace(/__DEV__/g, 'false'))
.pipe(gulp.dest('lib'));

});

gulp.task('browserify', function() {
return browserify(browserifyConfig)
.bundle()
.pipe(source('Flux.js'))
.pipe(gulp.dest('./'))
});

gulp.task('publish', ['clean', 'default']);
gulp.task('default', ['lib', 'browserify']);

16 changes: 0 additions & 16 deletions Makefile

This file was deleted.

10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@
"description": "",
"main": "index.js",
"scripts": {
"prepublish": "make clean && make all"
"prepublish": "./node_modules/.bin/gulp publish"
},
"author": "",
"license": "BSD",
"devDependencies": {
"browserify": "^4.2.3",
"react-tools": "^0.11.0"
"browserify": "^5.9.1",
"gulp": "^3.8.6",
"gulp-react": "^0.5.0",
"gulp-replace": "^0.4.0",
"gulp-rimraf": "^0.1.0",
"vinyl-source-stream": "^0.1.1"
}
}

0 comments on commit 045312b

Please sign in to comment.