-
Notifications
You must be signed in to change notification settings - Fork 24
/
gulpfile.js
35 lines (29 loc) · 974 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
var gulp = require('gulp');
var runSequence = require('run-sequence');
var concat = require('gulp-concat');
var config = require('./bower.json');
var bower = require('gulp-bower');
var source = 'lib/PathFinderPlugin.js';
var uglify = require('gulp-uglify');
gulp.task('default', function(){
gulp.run('build');
});
gulp.task('build', function() {
runSequence('bower', 'concat', 'minify');
});
gulp.task('bower', function(){
return bower();
});
gulp.task('concat', function() {
var easyStarVersion = require('./bower_components/easystarjs/package.json').version;
var sources = ['bower_components/easystarjs/bin/easystar-'+easyStarVersion+'.js', source];
gulp.src(sources)
.pipe(concat('phaser_pathfinding-' + config.version + '.js'))
.pipe(gulp.dest('bin'));
});
gulp.task('minify', function() {
gulp.src([source])
.pipe(concat('phaser_pathfinding-' + config.version + '.min.js'))
.pipe(uglify())
.pipe(gulp.dest('bin'));
});