pbs/gulpfile.js

37 lines
1.0 KiB
JavaScript
Raw Normal View History

2015-03-31 17:54:00 +02:00
var gulp = require('gulp')
var minifyCSS = require('gulp-minify-css')
var minifyHTML = require('gulp-minify-html')
2015-03-31 17:34:14 +02:00
var coffee = require('gulp-coffee')
2015-03-31 17:54:00 +02:00
var uglify = require('gulp-uglify')
var clean = require('gulp-clean')
2015-03-31 17:34:14 +02:00
gulp.task('css',function(){
return gulp.src('src/*.css')
2015-03-31 17:54:00 +02:00
.pipe(minifyCSS())
.pipe(gulp.dest('dist/'))
2015-03-31 17:34:14 +02:00
})
2015-03-31 17:54:00 +02:00
gulp.task('html',function(){
return gulp.src('src/*.html')
.pipe(minifyHTML({ quotes: true }))
.pipe(gulp.dest('dist/'))
})
2015-03-31 17:34:14 +02:00
gulp.task('coffee',function(){
return gulp.src('src/*.coffee')
2015-03-31 17:54:00 +02:00
.pipe(coffee({ bare: true }))
.pipe(uglify({ mangle: false }))
2015-03-31 17:54:00 +02:00
.pipe(gulp.dest('dist/'))
2015-03-31 17:34:14 +02:00
})
2015-03-31 17:54:00 +02:00
gulp.task('clean',function(){
return gulp.src('dist/*').pipe(clean())
})
2015-03-31 17:34:14 +02:00
gulp.task('watch',function(){
gulp.watch('src/*.coffee',['coffee'])
2015-03-31 17:54:00 +02:00
gulp.watch('src/*.css',['css'])
gulp.watch('src/*.html',['html'])
2015-03-31 17:34:14 +02:00
})
gulp.task('default',['html','css','coffee'])