-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
52 lines (46 loc) · 968 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
42
43
44
45
46
47
48
49
50
51
52
var gulp = require('gulp');
var jscs = require('gulp-jscs');
var jshint = require('gulp-jshint');
var jsdoc = require('gulp-jsdoc');
var rename = require("gulp-rename");
var paths = {
src: [
'src/**/*.js'
],
lib: [
'lib/**/!(*.es6)*.js'
],
test: [
'test/**/*.js'
]
};
gulp.task('docs', function () {
return gulp
.src(paths.lib.concat(
["README.md"]
))
.pipe(jsdoc('./docs'));
});
gulp.task('jscs', function () {
return gulp
.src(paths.src)
.pipe(jscs({
configPath: '.jscsrc',
esnext: true,
fix: true
}))
.pipe(gulp.dest('src'));
});
gulp.task('jshint', function () {
return gulp
.src(paths.src)
.pipe(jshint());
});
gulp.task('provide-color-src', function () {
return gulp
.src('src/color.js')
.pipe(rename('color.es6.js'))
.pipe(gulp.dest('lib'));
});
gulp.task('default', ['jshint']);
gulp.task('compile', ['jshint', 'jscs', 'docs', 'provide-color-src']);