-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgulpfile.js
More file actions
40 lines (34 loc) · 766 Bytes
/
Copy pathgulpfile.js
File metadata and controls
40 lines (34 loc) · 766 Bytes
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
var gulp = require('gulp');
var connect = require('gulp-connect');
var gp_concat = require('gulp-concat');
gulp.task('webserver', function() {
connect.server({
root: 'public',
livereload: true,
host: '127.0.0.1',
port: 8080,
});
});
gulp.task('reload', function() {
var files = [
'./*.html'
];
gulp.src(files)
.pipe(connect.reload());
});
gulp.task('concat', function() {
gulp.src(['./game/objects/**/*.js', './game/states/**/*.js', './game/index.js'])
.pipe(gp_concat('game.js'))
.pipe(gulp.dest('./public/scripts/'));
});
gulp.task('watch', function () {
gulp.watch([
'./index.html',
'./game/**/*.js',
], ['concat', 'reload']);
});
gulp.task('default', [
'webserver',
'concat',
'watch'
]);