forked from rtfmcorp/asylamba-game
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
53 lines (46 loc) · 1.42 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
53
'use strict';
// Include Gulp & tools we'll use
var gulp = require('gulp');
var gutil = require('gulp-util');
var less = require('gulp-less');
var rename = require('gulp-rename');
var replace = require('gulp-replace');
var imagemin = require('gulp-imagemin');
var jshint = require('gulp-jshint');
// -------------------- GULP TASKS --------------------
gulp.task('default', ['less'], () => {
return gutil.log('Gulp is running!')
});
// Build CSS with LESS sources
gulp.task('less', () => {
// specific faction files
for (var i = 1; i < 13; i++) {
gulp.src(['./public/css/less/main.desktop.v3.less'])
.pipe(replace('@color-type: 1;', '@color-type: '.concat(i, ';')))
.pipe(less())
.pipe(rename('main.desktop.v3.color' + i + '.css'))
.pipe(gulp.dest('./public/css/'));
}
// general file
gulp.src(['./public/css/less/main.desktop.v3.less'])
.pipe(less())
.pipe(gulp.dest('./public/css/'));
});
// Optimize images
gulp.task('images', () => {
gulp.src('public/css/src/desktop-src/**/*')
.pipe(imagemin({ progressive: true}))
.pipe(gulp.dest('public/css/src/desktop'))
gulp.src('public/media-src/**/*')
.pipe(imagemin({ progressive: true }))
.pipe(gulp.dest('public/media'))
});
// JS hint report
gulp.task('jshint', function() {
gulp.src('./public/js/main.desktop.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
gulp.src('./public/js/main.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
});