-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
35 lines (29 loc) · 890 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
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var jshint = require('gulp-jshint');
var mocha = require('gulp-mocha');
gulp.task('minify', [], function() {
return gulp.src('./linal.js')
.pipe(concat('linal.min.js'))
.pipe(uglify({ mangle: { keep_fnames: true }, compress: { keep_fnames: true } }))
.pipe(gulp.dest('.'));
});
gulp.task('validate', [], function() {
return gulp.src('./linal.js')
.pipe(jshint({ multistr: true }))
.pipe(jshint.reporter('default'));
});
gulp.task('test', ['minify'], function() {
return gulp.src(['./test/linal.js', './test/*.js', './test/**/*.js'])
.pipe(concat('test.js'))
.pipe(gulp.dest('.'))
.pipe(mocha({ reporter: 'spec' }));
});
gulp.task('watch', function() {
gulp.watch(['./linal.js', 'src/*', './src/**/*'], ['default']);
});
gulp.task('default', [
'validate',
'minify'
]);