forked from mattslocum/ng-webworker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
41 lines (34 loc) · 1.04 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
var gulp = require('gulp');
var KarmaServer = require('karma').Server;
var header = require('gulp-header');
var uglify = require('gulp-uglify');
var rename = require("gulp-rename");
gulp.task('default', ['watch']);
gulp.task('build', function(done) {
var pkg = require('./package.json');
var banner = [
'/**',
' * <%= pkg.name %> - <%= pkg.description %>',
' * @version v<%= pkg.version %>',
' * @link <%= pkg.homepage %>',
' * @license <%= pkg.license %>',
' */',
''].join('\n');
return gulp.src(['src/ng-webworker.js', 'src/worker_wrapper.js'])
.pipe(uglify({
mangle: {
except: ['notify', 'complete', '_transferable_']
}
}))
.pipe(header(banner, { pkg : pkg } ))
.pipe(rename({
suffix: ".min"
}))
.pipe(gulp.dest('src'));
});
gulp.task('test', function (done) {
new KarmaServer({
configFile: __dirname + '/karma.config.js',
singleRun: true
}, done).start();
});