-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
42 lines (37 loc) · 1.17 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
var gulp = require('gulp'),
mocha = require('gulp-mocha'),
jshint = require('gulp-jshint'),
stylish = require('jshint-stylish'),
bower = require ('main-bower-files'),
gulpFilter = require('gulp-filter'),
del = require('del');
gulp.task('test', function () {
if (typeof process.env.NODE_ENV === 'undefined') {
process.env.NODE_ENV = 'test';
}
return gulp.src('test/*', {read: false})
.pipe(mocha({ui: 'bdd', reporter: 'spec'}));
});
gulp.task('lint', function () {
return gulp.src(['src/js/*.js'])
.pipe(jshint())
.pipe(jshint.reporter(stylish));
});
gulp.task('bower', ['cleanup-vendor'], function () {
var jsFilter = gulpFilter('**/*.js');
var swfFilter = gulpFilter('**/*.swf');
var cssFilter = gulpFilter('**/*.css');
return gulp.src(bower())
.pipe(jsFilter)
.pipe(gulp.dest('vendor/js'))
.pipe(jsFilter.restore())
.pipe(swfFilter)
.pipe(gulp.dest('vendor/js'))
.pipe(swfFilter.restore())
.pipe(cssFilter)
.pipe(gulp.dest('vendor/css'))
});
gulp.task('cleanup-vendor', function () {
del.sync('vendor/js');
del.sync('vendor/css');
});