-
Notifications
You must be signed in to change notification settings - Fork 12
/
gulpfile.js
41 lines (36 loc) · 932 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
37
38
39
40
41
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var stylus = require('gulp-stylus');
var nib = require('nib');
var map = require('map-stream');
var errorReporter = function () {
return map(function (file, cb) {
if (!file.jshint.success) {
process.exit(1);
}
cb(null, file);
});
};
gulp.task('jshint', function() {
return gulp.src(['./static/js/**/*.js'])
.pipe(jshint({
asi:true,
laxbreak:true,
expr:true
}))
.pipe(jshint.reporter('default'))
.pipe(errorReporter());
});
gulp.task('stylus', function() {
return gulp.src(['./static/stylus/**/*.styl'])
.pipe(stylus({
use: [nib()],
'import': ['nib']
}))
.on('error', console.log)
.pipe(gulp.dest('./static/css/'));
});
gulp.task('watch', function() {
gulp.watch(["./static/stylus/**/*.styl"], ['stylus']);
});
gulp.task('default', ['jshint','stylus']);