-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
67 lines (55 loc) · 1.99 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//*********** IMPORTS *****************
var gulp = require('gulp');
var sass = require('gulp-ruby-sass');
var gutil = require('gulp-util');
var rename = require("gulp-rename");
var map = require("map-stream");
var livereload = require("gulp-livereload");
var concat = require("gulp-concat");
var babel = require('gulp-babel');
var uglify = require('gulp-uglify');
var include = require("gulp-include");
var run = require('gulp-run');
var open = require('gulp-open');
var notify = require("gulp-notify");
var buildFolder = './build';
gulp.task('default', ['build']);
gulp.task('buildAndLaunch',['build'], function(){
return gulp.src([buildFolder + '/game.html']).pipe(open());
});
gulp.task('art', function(){
gulp.src(['art/**/*'])
.pipe(gulp.dest(buildFolder + '/art'));
});
gulp.task('build', function(){
// Include third party scripts
// Pixi
gulp.src("./node_modules/pixi.js/dist/pixi.min.js")
.pipe(include())
.pipe(gulp.dest(buildFolder + "/js/"));
gulp.src("./node_modules/pixi.js/dist/pixi.min.js.map")
.pipe(include())
.pipe(gulp.dest(buildFolder + "/js/"));
// Pixi particles
gulp.src("./node_modules/pixi-particles/dist/pixi-particles.min.js")
.pipe(include())
.pipe(gulp.dest(buildFolder + "/js/"));
gulp.src("./node_modules/pixi-particles/dist/pixi-particles.min.js.map")
.pipe(include())
.pipe(gulp.dest(buildFolder + "/js/"));
// Pathfinding
gulp.src("./node_modules/pathfinding/visual/lib/pathfinding-browser.min.js")
.pipe(include())
.pipe(gulp.dest(buildFolder + "/js/"));
// Copy over game client
gulp.src(['game.html'])
.pipe(gulp.dest(buildFolder));
// Copy over game resources
gulp.src(['art/**/*'])
.pipe(gulp.dest(buildFolder + '/art'));
// Compile typescript
run('tsc').exec(function(){
gulp.src([buildFolder + '/game.html'])
.pipe(notify({title: 'Gulp', message: 'Build finished', wait: false }));
});
});