-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
47 lines (43 loc) · 1007 Bytes
/
gulpfile.js
File metadata and controls
47 lines (43 loc) · 1007 Bytes
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
37
38
39
40
41
42
43
44
45
46
47
/*
* Require gulp and all the modules
*/
var gulp = require('gulp'),
coffeelint = require('gulp-coffeelint'),
coffee = require('gulp-coffee'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
gulpif = require('gulp-if'),
watch = require('gulp-watch'),
gutil = require('gulp-util');
/*
* Paths
*/
var paths = {
coffee: ['./_coffee/*.coffee'],
js: ['./js/*.js']
};
/*
* Gulp default task
*/
gulp.task('default', ['scripts'], function() {
// Watch script changes
gulp.watch(paths.coffee, ['scripts', 'coffeelint']);
});
/*
* Gulp task for javascripts
*/
gulp.task('scripts', function() {
gulp.src(paths.coffee)
.pipe(gulpif(/[.]coffee$/, coffee({bare: true}).on('error', gutil.log)))
.pipe(uglify())
.pipe(concat('application.min.js'))
.pipe(gulp.dest('./js'));
});
/*
* Gulp task for linting coffee
*/
gulp.task('coffeelint', function() {
gulp.src(paths.coffee)
.pipe(coffeelint())
.pipe(coffeelint.reporter())
});