forked from tweenjs/tween.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
33 lines (27 loc) · 827 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
30
31
32
33
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var htmlreplace = require('gulp-html-replace');
var concat = require('gulp-concat');
var insert = require('gulp-insert');
var metadata = require('./package');
var header = '// ' + metadata.name + ' v' + metadata.version + ' ' + metadata.homepage + '\n';
gulp.task('lint', function() {
return gulp.src('src/Tween.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('min', function() {
return gulp.src([
'src/Tween.js'
])
.pipe(uglify())
.pipe(insert.prepend(header))
.pipe(rename('tween.min.js'))
.pipe(gulp.dest('build'));
});
gulp.task('watch', function() {
gulp.watch('src/*.js', ['lint', 'min']);
});
gulp.task('default', ['lint', 'min', 'watch']);