Created
January 24, 2014 22:02
-
-
Save traviskroberts/8607625 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
gulp = require 'gulp' | |
gutil = require 'gulp-util' | |
# contrib modules | |
streamee = require 'streamee' | |
concat = require 'gulp-concat' | |
coffee = require 'gulp-coffee' | |
uglify = require 'gulp-uglify' | |
sass = require 'gulp-sass' | |
gulp.task 'appScripts', -> | |
streamee.interleave([ | |
gulp.src(['src/javascripts/**/*.coffee', '!src/javascripts/vendor.js.coffee']).pipe(coffee()) | |
gulp.src('src/javascripts/**/*.js') | |
]) | |
.pipe(concat 'app.js') | |
.pipe(uglify()) | |
.pipe(gulp.dest 'assets/javascripts/') | |
gulp.task 'vendorScripts', -> | |
gulp.src('vendor/javascripts/**/*.js') | |
.pipe(concat 'vendor.js' ) | |
.pipe(uglify()) | |
.pipe(gulp.dest './assets/javascripts/') | |
gulp.task 'styles', -> | |
gulp.src('src/stylesheets/screen.scss') | |
.pipe(sass(includePaths: ['vendor/stylesheets'])) | |
.pipe(concat 'screen.css') | |
.pipe(gulp.dest 'assets/stylesheets/') | |
gulp.task 'watch', -> | |
gulp.watch 'src/javascripts/**', (e) -> | |
console.log "File #{e.path} was #{e.type}, running tasks..." | |
gulp.run 'appScripts' | |
gulp.watch 'vendor/javascripts/**/*.js', (e) -> | |
console.log "File #{e.path} was #{e.type}, running tasks..." | |
gulp.run 'vendorScripts' | |
gulp.watch 'src/stylesheets/**', (e) -> | |
console.log "File #{e.path} was #{e.type}, running tasks..." | |
gulp.run 'styles' | |
gulp.task 'default', ['appScripts', 'vendorScripts', 'styles', 'watch'] |
Author
traviskroberts
commented
Jan 24, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment