Created
May 6, 2015 04:40
-
-
Save hidex7777/f57cc29697f04a65addd to your computer and use it in GitHub Desktop.
Gulpでscss, coffee, imagemin, livereload
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' | |
imagemin = require 'gulp-imagemin' | |
plumber = require 'gulp-plumber' | |
coffee = require 'gulp-coffee' | |
concat = require 'gulp-concat' | |
uglify = require 'gulp-uglify' | |
sass = require 'gulp-sass' | |
webserver = require 'gulp-webserver' | |
gulp.task 'img', -> | |
gulp.src ['./src/image/*.jpg', './src/image/*.png'] | |
.pipe imagemin() | |
.pipe gulp.dest './dist/image' | |
gulp.task 'js', -> | |
gulp.src './src/coffee/*.coffee' | |
.pipe plumber() | |
.pipe coffee() | |
.pipe concat 'all.min.js' | |
.pipe uglify() | |
.pipe gulp.dest './dist/js' | |
gulp.task 'css', -> | |
gulp.src './src/scss/*.scss' | |
.pipe plumber() | |
.pipe sass() | |
.pipe gulp.dest './dist/css' | |
gulp.task 'watch', -> | |
gulp.watch './src/coffee/*.coffee', ['js'] | |
gulp.watch './src/scss/*.scss', ['css'] | |
gulp.watch './dist/*.html', ['watch'] | |
gulp.task 'webserver', -> | |
gulp.src './dist' | |
.pipe webserver { | |
host: 'localhost' | |
livereload: true | |
} | |
gulp.task 'default', ['img', 'js', 'css', 'watch', 'webserver'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment