pbs/gulpfile.js

68 lines
2.3 KiB
JavaScript
Raw Permalink 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-04-01 13:01:53 +02:00
var markdown = require('gulp-markdown')
2015-03-31 17:34:14 +02:00
gulp.task('css',function(){
2015-03-31 19:59:23 +02:00
cssFiles = ["src/*.css","bower_components/vis/dist/vis.min.css",
2015-03-31 21:06:13 +02:00
"bower_components/sweetalert/lib/sweet-alert.css",
2015-03-31 19:59:23 +02:00
"bower_components/bootstrap/dist/css/bootstrap.css"]
return gulp.src(cssFiles)
2015-04-01 09:46:27 +02:00
.pipe(gulp.dest('test/'))
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')
2015-04-01 09:46:27 +02:00
.pipe(gulp.dest('test/'))
.pipe(minifyHTML({ quotes: true }))
.pipe(gulp.dest('dist/'))
})
2015-04-01 13:01:53 +02:00
gulp.task('md',function(){
return gulp.src(['src/*.md','*.md'])
.pipe(markdown())
.pipe(gulp.dest('test/'))
.pipe(minifyHTML({ quotes: true }))
.pipe(gulp.dest('dist/'))
})
2015-03-31 19:59:23 +02:00
gulp.task('js',function(){
jsFiles = ["src/*.js",
"bower_components/jquery/dist/jquery.js",
2015-04-01 09:46:27 +02:00
"bower_components/moment/moment.js",
2015-04-01 10:14:58 +02:00
"bower_components/bootstrap/dist/js/bootstrap.js",
"bower_components/bootstrap/js/collapse.js",
2015-03-31 19:59:23 +02:00
"bower_components/angular/angular.js",
2015-03-31 21:06:13 +02:00
"bower_components/sweetalert/lib/sweet-alert.js",
2015-03-31 19:59:23 +02:00
"bower_components/angular-ui-router/release/angular-ui-router.js",
"bower_components/vis/dist/vis.min.js"]
2015-04-01 09:46:27 +02:00
return gulp.src(jsFiles).pipe(gulp.dest('test/'))
.pipe(uglify({ mangle: false }))
2015-03-31 19:59:23 +02:00
.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 }))
2015-04-01 09:46:27 +02:00
.pipe(gulp.dest('test/'))
.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(){
2015-04-01 09:46:27 +02:00
return gulp.src(['dist/*','test/*']).pipe(clean())
2015-03-31 17:54:00 +02:00
})
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'])
2015-04-01 13:01:53 +02:00
gulp.watch(['*.md','src/*.md'],['md'])
gulp.watch('src/*.html',['html'])
2015-03-31 17:34:14 +02:00
})
2015-04-01 13:01:53 +02:00
gulp.task('default',['md','html','css','js','coffee'])