-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
executable file
·46 lines (38 loc) · 1.01 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
43
44
45
46
var gulp = require('gulp');
var concat = require('gulp-concat');
var gulpSequence = require('gulp-sequence');
var jshint = require('gulp-jshint');
var Server = require('karma').Server;
var uglify = require('gulp-uglify');
var js = [
'src/reload.js',
'src/*.js'
];
var dist = 'dist/';
var tests = 'tests/';
var examples = 'examples/';
gulp.task('build:prod', function() {
return gulp.src(js)
.pipe(concat('reload.js'))
.pipe(uglify())
.pipe(gulp.dest(dist));
});
gulp.task('build:dev', function() {
return gulp.src(js)
.pipe(concat('reload.js'))
.pipe(gulp.dest(dist));
});
gulp.task('lint', function() {
return gulp.src(js)
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'));
});
gulp.task('test:run', function() {
new Server({
configFile: __dirname + "/" + tests + 'config/karma.conf.js',
singleRun: true
}).start();
});
gulp.task('default', ['lint', 'build:prod']);
gulp.task('test', gulpSequence('lint', 'build:prod', 'test:run'));