-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
70 lines (64 loc) · 1.52 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
var gulp = require('gulp'),
karma = require('karma').server,
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
ngAnnotate = require('gulp-ng-annotate'),
sourceFiles = [
'src/wsScriptLoader.prefix',
'src/wsScriptLoader.js',
'src/wsScriptLoader.suffix'
];
gulp.task('build', function() {
gulp.src(sourceFiles)
.pipe(concat('ws-script-loader.js'))
.pipe(ngAnnotate())
.pipe(gulp.dest('./dist/'))
.pipe(uglify())
.pipe(rename('ws-script-loader.min.js'))
.pipe(gulp.dest('./dist'))
});
/**
* Run test once and exit
*/
gulp.task('test', function (done) {
karma.start({
configFile: __dirname + '/karma-src.conf.js',
singleRun: true
}, function() {
done();
});
});
gulp.task('test-debug', function (done) {
karma.start({
configFile: __dirname + '/karma-src.conf.js',
singleRun: false,
autoWatch: true
}, function() {
done();
});
});
/**
* Run test once and exit
*/
gulp.task('test-dist-concatenated', function (done) {
karma.start({
configFile: __dirname + '/karma-dist-concatenated.conf.js',
singleRun: true
}, function() {
done();
});
});
/**
* Run test once and exit
*/
gulp.task('test-dist-minified', function (done) {
karma.start({
configFile: __dirname + '/karma-dist-minified.conf.js',
singleRun: true
}, function() {
done();
});
});
gulp.task('default', ['test', 'build']);
gulp.task('dist', ['test','test-dist-concatenated', 'test-dist-minified']);