ld31-space-diggers/gulpfile.js

36 lines
1 KiB
JavaScript
Raw Normal View History

2014-12-02 00:01:16 +01:00
// npm install -g gulp
// npm install --save-dev browser-sync
var gulp = require('gulp');
var coffee = require('gulp-coffee');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var sourcemaps = require('gulp-sourcemaps');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
gulp.task('server', function() {
browserSync({
server: {
baseDir: 'public'
}
});
});
gulp.task('compile', function() {
2014-12-07 15:52:54 +01:00
return gulp.src(['src/entities/*.coffee', 'src/items/*.coffee', , 'src/tiles/*.coffee', 'src/tools.coffee', 'src/app.coffee', 'src/game.coffee', 'src/hud.coffee', 'src/speechbubble.coffee'])
2014-12-02 00:01:16 +01:00
.pipe(sourcemaps.init())
2014-12-06 08:37:36 +01:00
.pipe(coffee({bare: true}))
2014-12-02 00:01:16 +01:00
.pipe(concat('app.js'))
.pipe(sourcemaps.write())
.pipe(gulp.dest('public'));
});
gulp.task('default', ['server'], function() {
2014-12-06 09:14:03 +01:00
gulp.watch(['src/**/*.coffee'], ['compile']);
2014-12-02 00:01:16 +01:00
gulp.watch(['*.html', 'styles.css', 'app.js', 'images/*'], {cwd: 'public'}, reload);
});