-
Notifications
You must be signed in to change notification settings - Fork 163
/
gulpfile.js
53 lines (43 loc) · 1.15 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
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var jshint = require('gulp-jshint');
var minifycss = require('gulp-minify-css');
var path = require('path');
var zip = require('gulp-zip');
var gulpsync = require('gulp-sync')(gulp);
var paths = {
appJs: ['./game/**/*.js'],
css: './css/**/*.css'
};
//lint js code
gulp.task('lintJs', function () {
return gulp.src(paths.appJs)
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
});
/**
* concat all app files and create mapping
*/
gulp.task('compileJs', function () {
return gulp.src(paths.appJs)
.pipe(concat('game.js'))
.pipe(uglify({
mangle: true
}))
.pipe(gulp.dest('build/'));
});
/**
* compile stylus to css and minify it
*/
gulp.task('compileCss', function () {
return gulp.src(paths.css)
.pipe(minifycss())
.pipe(gulp.dest('build/'));
});
gulp.task('zip', function (){
return gulp.src('build/*')
.pipe(zip('TheMoleGame.zip'))
.pipe(gulp.dest(''));
});
gulp.task('default', gulpsync.sync(['compileJs', 'compileCss', 'zip','lintJs']));