-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGulpfile.js
34 lines (27 loc) · 836 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
var gulp = require('gulp');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var jshint = require('gulp-jshint');
var mocha = require('gulp-mocha');
var jsFiles = 'src/*.js', jsDest = 'dist';
gulp.task('build', function () {
return gulp.src(jsFiles)
.pipe(concat('tongue.js'))
.pipe(gulp.dest(jsDest))
.pipe(rename('tongue.min.js'))
.pipe(uglify())
.pipe(gulp.dest(jsDest))
});
gulp.task('jshint', function () {
return gulp.src(jsFiles)
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(jshint.reporter('fail'))
});
gulp.task('test', function () {
return gulp.src('test.js', {read: false})
// gulp-mocha needs filepaths so you can't have any plugins before it
.pipe(mocha({reporter: 'nyan'}));
});
gulp.task('default', ['jshint', 'build']);