forked from sahat/satellizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
39 lines (33 loc) · 1.02 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
var gulp = require('gulp');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var plumber = require('gulp-plumber');
var complexity = require('gulp-complexity');
var header = require('gulp-header');
var pkg = require('./package.json');
var banner = ['/**',
' * Satellizer <%= pkg.version %>',
' * (c) 2015 <%= pkg.author.name %>',
' * License: <%= pkg.license %>',
' */',
''].join('\n');
gulp.task('minify', function() {
return gulp.src('satellizer.js')
.pipe(plumber())
.pipe(uglify())
.pipe(header(banner, { pkg: pkg }))
.pipe(rename({ suffix: '.min' }))
.pipe(gulp.dest('.'));
});
gulp.task('copy', ['minify'], function() {
return gulp.src('satellizer.js')
.pipe(gulp.dest('examples/client/vendor'));
});
gulp.task('complexity', function() {
return gulp.src('satellizer.js')
.pipe(complexity());
});
gulp.task('watch', function() {
gulp.watch('satellizer.js', ['copy', 'minify']);
});
gulp.task('default', ['copy', 'watch']);