-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
61 lines (54 loc) · 1.62 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
54
55
56
57
58
59
60
61
var gulp = require('gulp');
var concat = require('gulp-concat');
var mainBowerFiles = require('main-bower-files');
var uglify = require('gulp-uglify');
var minifycss = require('gulp-minify-css');
var gulpMerge = require('gulp-merge');
var less = require('gulp-less');
var debug = require('gulp-debug');
var paths = {
bower_js: mainBowerFiles({filter:'**/*.js'}),
js: [
'bower_components/socket.io-client/socket.io.js',
'scripts/**/*.js'
],
css: mainBowerFiles({filter:'**/*.css'}),
less: 'less/*.less',
fonts: 'bower_components/foundation-icon-fonts/*.{eot,woff,ttf,svg}',
html: 'www/**.html',
build: 'www/**'
};
paths.js = paths.bower_js.concat(paths.js);
gulp.task('scripts', function() {
return gulp.src(paths.js)
.pipe(debug({title: 'scripts'}))
.pipe(concat('script.js'))
//.pipe(uglify())
.pipe(gulp.dest('www/'));
});
gulp.task('style', function() {
return gulpMerge(
gulp.src(paths.css),
gulp.src(paths.less)
.pipe(debug({title: 'less'}))
.pipe(less())
)
.pipe(debug({title: 'css'}))
.pipe(concat('style.css'))
.pipe(minifycss())
.pipe(gulp.dest('www/'));
});
gulp.task('fonts',function() {
return gulp.src(paths.fonts)
//.pipe(debug())
.pipe(gulp.dest('www'));
});
// Watch Files For Changes
gulp.task('watch', function() {
gulp.watch(paths.js, ['scripts']);
gulp.watch(paths.css, ['style']);
gulp.watch(paths.less, ['style']);
gulp.watch('gulpfile.js', ['default']);
});
gulp.task('default', ['scripts','style','fonts','watch']);
// Try: gulp-livereload & tiny-lr