forked from hexus/phaser-arcade-slopes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
37 lines (33 loc) · 943 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
34
35
36
37
var gulp = require('gulp'),
util = require('gulp-util'),
banner = require('gulp-banner'),
concat = require('gulp-concat'),
rename = require('gulp-rename'),
uglify = require('gulp-uglify');
pack = require('./package.json');
var comment = ['/**',
' * Phaser Arcade Slopes v<%= package.version %>',
' *',
' * <%= package.description %>',
' *',
' * @copyright 2016-2018 <%= package.author %>',
' * @license <%= package.license %>',
' * @see <%= package.homepage %>',
' */',
''
].join('\n');
gulp.task('default', ['build']);
gulp.task('build', function () {
return gulp.src(['src/**/*.js', 'node_modules/sat/SAT.js'])
.pipe(concat('phaser-arcade-slopes.js'))
.pipe(gulp.dest('dist'))
.pipe(rename({suffix: '.min'}))
.pipe(uglify())
.pipe(banner(comment, {
package: pack
}))
.pipe(gulp.dest('dist'));
});
gulp.task('watch', function () {
gulp.watch('src/**/*.js', ['build']);
});