-
Notifications
You must be signed in to change notification settings - Fork 8
/
gulpfile.js
36 lines (34 loc) · 966 Bytes
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
gulp = require('gulp')
jscs = require('gulp-jscs')
gutil = require('gulp-util')
batch = require('gulp-batch')
watch = require('gulp-watch')
coffee = require('gulp-coffee')
uglify = require('gulp-uglifyjs')
plumber = require('gulp-plumber')
sourcemaps = require('gulp-sourcemaps')
prettify = require('gulp-jsbeautifier')
scripts = 'lib/**/*.coffee';
gulp.task('build', function() {
return gulp
.src(scripts)
.pipe(watch(scripts))
.pipe(plumber())
.pipe(sourcemaps.init())
.pipe(coffee({bare: true}))
.pipe(jscs({fix:true}))
.pipe(prettify({
js: {
indentWithTabs: true,
braceStyle: 'end-collapse'
}
}))
.pipe(sourcemaps.write())
.pipe(gulp.dest('bin'));
})
gulp.task('watch', function() {
watch(scripts, batch(function(events, done){
gulp.start('build', done)
}));
})
gulp.task('default', ['build', 'watch']);