-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
43 lines (39 loc) · 1 KB
/
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
42
43
var fs = require('fs');
var packageJSON = require('./package.json');
var gulp = require('gulp');
var stylus = require('gulp-stylus');
var jade = require('gulp-jade');
var jshint = require('gulp-jshint');
var gulpif = require('gulp-if');
var rename = require("gulp-rename");
// stylus
gulp.task('stylus', function() {
return gulp.src('src/stylus/*.styl')
.pipe(stylus())
.pipe(rename(function(path) {
path.basename += '-' + packageJSON.version;
}))
.pipe(gulp.dest('./examples/css/'));
});
// jade
gulp.task('jade', function() {
return gulp.src(['src/jade/*.jade', 'src/jade/**/*.jade'])
.pipe(jade({
locals: {
version: packageJSON.version
}
}))
.pipe(gulp.dest('./'));
});
// jshint
gulp.task('jshint', function() {
return gulp.src('*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
// watch
gulp.task('watch', function() {
gulp.watch('*.js', ['jshint']);
gulp.watch('src/jade/**', ['jade']);
gulp.watch('src/stylus/**', ['stylus']);
});