-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
36 lines (30 loc) · 863 Bytes
/
gulpfile.js
File metadata and controls
36 lines (30 loc) · 863 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
var gulp = require('gulp');
var webpack = require('webpack-stream');
// Who watches the watch tasks?
gulp.task('watch:js', function() {
gulp.watch('app/js/**/*.js', ['webpack:dev']);
});
gulp.task('watch:html', function() {
gulp.watch('app/**/*.html', ['static:dev']);
});
// Move static files to build
gulp.task('static:dev', function() {
return gulp.src(['app/*.html', 'app/*.css'])
.pipe(gulp.dest('build'));
});
// Move meat and bones to build
gulp.task('webpack:dev', function() {
return gulp.src(['app/js/game.js'])
.pipe(webpack({
output: {
filename: 'bundle.js'
}
}))
.pipe(gulp.dest('build'));
});
gulp.task('watch:all', ['watch:js', 'watch:html']);
gulp.task('build:dev', ['webpack:dev', 'static:dev']);
gulp.task('default', ['build:dev']);
// gulp.doneCallback = function(err) {
// process.exit(err ? 1 : 0);
// };