-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
65 lines (55 loc) · 1.49 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
var gulp = require('gulp'),
gutil = require('gulp-util'),
jshint = require('gulp-jshint'),
stylish = require('jshint-stylish'),
connect = require('gulp-connect'),
compass = require('gulp-compass'),
rename = require('gulp-rename'),
minifyCSS = require('gulp-minify-css'),
yuidoc = require('gulp-yuidoc'),
karma = require('karma'),
path = {
src: './src/**/*.js',
scss: './scss/husky.scss'
};
gulp.task('lint', function() {
gulp.src(path.src)
.pipe(jshint())
.pipe(jshint.reporter(stylish));
});
gulp.task('compass', function() {
gulp.src(path.scss)
.pipe(compass({
css: './css',
sass: './scss'
}))
.pipe(minifyCSS())
.pipe(rename('husky.min.css'))
.pipe(gulp.dest('./dist/css'));
});
gulp.task('doc', function() {
gulp.src(path.src)
.pipe(yuidoc())
.pipe(gulp.dest('./doc'));
});
//a helper function to report karma's exit status
function karmaExit(exitCode) {
gutil.log('Karma has exited with ' + exitCode);
process.exit(exitCode);
}
gulp.task('test', function() {
karma.server.start({
configFile: __dirname + '/karma.conf.js',
singleRun: true
}, karmaExit);
});
gulp.task('tdd', function() {
karma.server.start({
configFile: __dirname + '/karma.conf.js'
}, karmaExit);
});
gulp.task('connect', function() {
connect.server();
});
gulp.task('default', ['connect']);
gulp.task('build', ['lint']);