Created
September 29, 2014 22:50
-
-
Save ryan953/6fd0edaeb90e4533294c to your computer and use it in GitHub Desktop.
This file contains 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
/* jshint node:true */ | |
'use strict'; | |
var gulp = require('gulp'); | |
var source = require('vinyl-source-stream'); | |
var browserify = require('gulp-browatchify'); | |
var reactify = require('reactify'); // reactify transform | |
var rework = require('gulp-rework'); | |
var at2x = require('rework-plugin-at2x'); | |
var csso = require('gulp-csso'); | |
var vars = require('rework-vars'); | |
var reworkNPM = require('rework-npm'); | |
gulp.task('browserify', function () { | |
gulp.src('./public/js/app.js') | |
.pipe(browserify({debug: !process.env.production, transforms:[reactify]})) | |
.pipe(source('build.js')) | |
.pipe(gulp.dest('./public/')); | |
}); | |
gulp.task('rework', function () { | |
return gulp.src('./public/css/main.css') | |
.pipe(rework( | |
at2x(), | |
reworkNPM(), | |
vars(), | |
{sourcemap: true}) | |
) | |
.pipe(csso()) | |
.pipe(gulp.dest('./public')); | |
}); | |
gulp.watch('./public/js/*.js', ['browserify']); | |
gulp.watch('./public/css/*.css', ['rework']); | |
gulp.task('default', ['browserify', 'rework']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment