Skip to content

Instantly share code, notes, and snippets.

@tanaka51 tanaka51/

Last active Sep 3, 2015
What would you like to do?
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', ->
.pipe plumber()
.pipe coffee bare: true
.on 'error', util.log
.pipe gulp.dest './dest/js'
gulp.task 'watch-coffee', -> 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', -> 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', -> 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', -> 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
You can’t perform that action at this time.