forked from fat/zoom.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
29 lines (26 loc) · 791 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
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var gfi = require('gulp-file-insert');
var header = require('gulp-header');
var pkg = require('./package.json');
var banner = ['/**',
' * <%= pkg.name %> - <%= pkg.description %>',
' * @version v<%= pkg.version %>',
' * @link <%= pkg.homepage %>',
' * @license <%= pkg.license %>',
' */',
'',
''].join('\n');
gulp.task('compress', function() {
gulp.src('js/*.js')
.pipe(header(banner, { pkg : pkg } ))
.pipe(gulp.dest('dist'))
.pipe(uglify())
.pipe(header(banner, { pkg : pkg } ))
.pipe(rename({
extname: '.min.js'
}))
.pipe(gulp.dest('dist'))
});
gulp.task('default', [ 'compress' ]);