autoprefixerConfig =
browsers: ['> 5%']
cascade: true
gulp = require 'gulp'
concat = require 'gulp-concat'
livereload = require 'gulp-livereload'
plumber = require 'gulp-plumber'
notify = require 'gulp-notify'
autoprefixer = require 'gulp-autoprefixer'
sass = require 'gulp-sass'
SCSS Compilation
gulp.task 'css', () ->
gulp.src 'resources/stylesheets/eqtv.scss'
.pipe plumber({errorHandler: notify.onError("Error: <%= error.message %>")})
.pipe sass()
.pipe autoprefixer autoprefixerConfig
.pipe gulp.dest 'www/css'
.pipe notify 'Application SCSS has been compiled'
Copy fonts
gulp.task 'copy:fonts', () ->
gulp.src [
'bower_components/bootstrap-sass/assets/fonts/**/*'
'bower_components/font-awesome/fonts/**/*'
]
.pipe gulp.dest('www/fonts')
Copy JS
gulp.task 'copy:js', () ->
gulp.src [
'bower_components/nanoscroller/bin/javascripts/jquery.nanoscroller.js'
]
.pipe gulp.dest('www/js/vendor')
Realtime Compilation
gulp.task 'watch', ['build'], () ->
livereload.listen();
gulp.watch('resources/stylesheets/**/*.scss', ['css'])
gulp.watch('www/css/eqtv.css').on 'change', livereload.changed
gulp.watch('templates/**/*.jade').on 'change', livereload.changed
Build everything!
gulp.task 'build', ['css', 'copy:fonts', 'copy:js']
# Not much else to do here - everything has already run!
Default Task
gulp.task 'default', ['build'] # All we do is call build!