Skip to content

Instantly share code, notes, and snippets.

@tanaka51
Last active September 3, 2015 11:49
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tanaka51/a745affd136187dacffb to your computer and use it in GitHub Desktop.
gulp = require 'gulp'
util = require 'gulp-util'
coffee = require 'gulp-coffee'
sass = require 'gulp-sass'
slim = require 'gulp-slim'
plumber = require 'gulp-plumber'
COFFEE_FILES = './src/coffee/**/*.coffee'
gulp.task 'coffee', ->
gulp.src COFFEE_FILES
.pipe plumber()
.pipe coffee bare: true
.on 'error', util.log
.pipe gulp.dest './dest/js'
gulp.task 'watch-coffee', ->
gulp.watch COFFEE_FILES, ['coffee']
SASS_FILES = './src/sass/**/*.sass'
gulp.task 'sass', ->
gulp.src SASS_FILES
.pipe plumber()
.pipe sass indentedSyntax: true
.pipe gulp.dest './dest/css'
gulp.task 'watch-sass', ->
gulp.watch SASS_FILES, ['sass']
SLIM_FILES = './src/slim/**/*.slim'
gulp.task 'slim', ->
gulp.src SLIM_FILES
.pipe plumber()
.pipe slim pretty: true
.pipe gulp.dest './dest/html'
gulp.task 'watch-slim', ->
gulp.watch SLIM_FILES, ['slim']
IMAGE_FILES = './src/images/**/*.{jpg,jpeg,png,gif}'
gulp.task 'images', ->
gulp.src IMAGE_FILES
.pipe gulp.dest './dest/images'
gulp.task 'watch-images', ->
gulp.watch IMAGE_FILES, ['images']
gulp.task 'watch', ['watch-coffee', 'watch-sass', 'watch-slim', 'watch-images']
gulp.task 'default', ['coffee', 'sass', 'slim', 'images']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment