-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
37 lines (30 loc) · 868 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
'use strict';
var gulp = require('gulp'),
concat = require('gulp-concat'),
jshint = require('gulp-jshint'),
uglify = require('gulp-jshint');
function buildScripts(src, intermediate, dest) {
return function() {
gulp.src(src)
.pipe(concat(intermediate))
.pipe(uglify())
.pipe(gulp.dest(dest));
}
}
gulp.task('test', function() {
return gulp.src(['src/*.js'])
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(jshint.reporter('fail'));
});
gulp.task('build-jquery', ['test'], buildScripts(
['src/konamicode.js','src/konamicode.jquery.js'],
'konamicode.jquery.min.js',
'build'
));
gulp.task('build-min', ['test'], buildScripts(
['src/konamicode.js'],
'konamicode.min.js',
'build'
));
gulp.task('default', ['build-min', 'build-jquery']);