-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
50 lines (38 loc) · 1.01 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
var gulp = require('gulp');
var zip = require('gulp-zip');
var size = require('gulp-filesize');
var uglify = require('gulp-uglify');
var htmlmin = require('gulp-htmlmin');
var zipFile = 'js13k.zip';
var paths = {
scripts: ['player.js','game.js', 'jsfxr.min.js'],
pngs:['*.png'],
htmls:['*.html'],
dist:'./deploy/',
processed: './deploy/*.*'
};
gulp.task('copyResources', function() {
gulp.src(paths.pngs)
.pipe(gulp.dest(paths.dist));
});
gulp.task('minifyHTML', function() {
gulp.src(paths.htmls)
.pipe(htmlmin({collapseWhitespace: true}))
.pipe(gulp.dest(paths.dist));
});
gulp.task('uglify', function() {
gulp.src(paths.scripts)
.pipe(uglify())
.pipe(gulp.dest(paths.dist));
});
gulp.task('deploy', function() {
gulp.src(paths.processed)
.pipe(zip('js13k.zip'))
.pipe(gulp.dest(paths.dist));
});
gulp.task('size', function() {
gulp.src(paths.dist+zipFile)
.pipe(size());
});
gulp.task('default', function() {
});