Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var gulp = require('gulp');
var gutil = require('gulp-util');
var sass = require('gulp-ruby-sass');
var watch = require('gulp-watch');
var plumber = require('gulp-plumber');
var traceur = require('gulp-traceur');
var jshint = require('gulp-jshint');
var stylish = require('jshint-stylish');
var notify = require('gulp-notify');
gulp.task('default', ['sass', 'foundation', 'js']);
gulp.task('js', function(){
gulp.src('client/app/**/*.js').
pipe(watch()).
pipe(plumber()).
pipe(jshint('.jshintrc')).
pipe(jshint.reporter(stylish)).
pipe(notify(function(file){
var message = "";
if(file.jshint.results){
file.jshint.results.forEach(function(err){
var path = err.file.replace(process.cwd() + '/');
message += err.error.reason + " - " + path;
});
return message;
}
})).
pipe(traceur({ sourceMap: true })).
pipe(gulp.dest('client/js')).
on("error", notify.onError());
});
/// styling
gulp.task('sass', function(){
gulp.src('client/style/**/*.sass').
pipe(watch()).
pipe(plumber()).
pipe(sass({ lineNumbers: true })).
pipe(gulp.dest('client/css')).
on("error", notify.onError());
});
gulp.task('foundation', ['foundation:build'], function(){
gulp.watch('client/foundation/**/*.s[ac]ss', ['foundation:build']);
});
gulp.task('foundation:build', function(){
gulp.src('client/foundation/foundation.sass').
pipe(sass({ lineNumbers: true })).
pipe(gulp.dest('client/css/foundation')).
on("error", notify.onError());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.