-
Notifications
You must be signed in to change notification settings - Fork 93
/
Copy pathgulpfile.js
37 lines (30 loc) · 1.05 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
var
gulp = require('gulp'),
browserify = require('gulp-browserify'),
uglify = require('gulp-uglify'),
append = require('gulp-append-prepend'),
concat = require('gulp-concat');
package = require('./package.json');
gulp.task('build', function () {
var aboutText = "/**\n"+
" * "+package.name+" v"+package.version+"\n"+
" *\n"+
" * @copyright 2011-"+(new Date().getFullYear())+" "+package.author+"\n"+
" * @link "+package.homepage+"\n"+
" * @license "+package.license+"\n"+
" */\n";
return gulp.src(['./src/main.js'])
.pipe(browserify())
.pipe(uglify())
.pipe(append.prependText(aboutText))
.pipe(concat('apng-canvas.min.js'))
.pipe(gulp.dest('./build/'));
});
gulp.task('devel', function () {
return gulp.src(['./src/main.js'])
.pipe(browserify({debug: true}))
.pipe(concat('apng-canvas.js'))
.pipe(gulp.dest('./test/'));
});
gulp.task('watch', function () { return gulp.watch('./src/*.js', ['devel']);});
gulp.task('default', gulp.series('build'));