-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
47 lines (38 loc) · 1.17 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
var gulp = require('gulp');
var minifycss = require('gulp-minify-css');
var less = require('gulp-less');
var browserSync = require('browser-sync');
var watch = require('gulp-watch');
var gutil = require('gulp-util');
var clean = require('gulp-clean');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var filesize = require('gulp-filesize');
var changed = require('gulp-changed');
var jsWatchPath = [];
var jsSourceFiles = [];
var lessWatchPath = ['html/css/less/**'];
var lessFiles = ['html/css/less/styles.less'];
var cssOutputPath = 'html/css';
// BrowserSync
gulp.task('browser-sync', function() {
browserSync({
proxy: 'html5tetris'
})
});
// Less & CSS tasks
gulp.task('less', function() {
gulp.src(lessFiles)
.pipe(less())
.pipe(gulp.dest(cssOutputPath))
.pipe(browserSync.reload({stream: true}));
});
gulp.task('js', function() {
gulp.src(['html/js/**/*.js', 'html/game/**/*.js'])
.pipe(browserSync.reload({stream:true}));
});
gulp.task('default', ['browser-sync'], function() {
gulp.watch(lessWatchPath, ['less']);
gulp.watch('html/**/*.js', ['js']);
});