-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
64 lines (56 loc) · 2.02 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
62
63
64
var gulp = require('gulp'),
clean = require('gulp-clean'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
rename = require('gulp-rename'),
gutil = require('gulp-util'),
less = require('gulp-less'),
minify = require('gulp-minify-css'),
hint = require('gulp-jshint'),
rev = require('gulp-rev');
gulp.task('clean', function() {
return gulp.src(['public/build',], {read: false})
.pipe(clean());
});
gulp.task('less', function() {
return gulp.src('public/stylesheets/*.less')
.pipe(less())
.pipe(gulp.dest('public/stylesheets/'));
});
gulp.task('css', function() {
return gulp.src(['public/stylesheets/vendor/**/*.css', 'public/stylesheets/*.css'])
.pipe(minify())
.pipe(concat('build.min.css'))
.pipe(gulp.dest('public/build'));
});
gulp.task('lint', function() {
return gulp.src(['*.js', 'public/javascripts/*.js'])
.pipe(hint())
.pipe(hint.reporter('default'));
});
gulp.task('js', function() {
return gulp.src(['public/javascripts/vendor/jquery.min.js',
'public/javascripts/vendor/jquery-ui.min.js',
'public/javascripts/vendor/fastclick.js',
'public/javascripts/vendor/modernizr.js',
'public/javascripts/vendor/foundation.min.js',
'public/javascripts/vendor/moment.js',
'public/javascripts/vendor/placeholder.js',
'public/javascripts/vendor/socket.io.js',
'public/javascripts/chat.js'
])
.pipe(concat('build.js'))
.pipe(uglify())
.pipe(rename('build.min.js'))
.pipe(gulp.dest('public/build'))
.on('error', gutil.log);
});
gulp.task('rev', ['css', 'js'], function() {
return gulp.src(['public/build/*.js', 'public/build/*.css'], {base: 'public/build'})
.pipe(gulp.dest('public/build'))
.pipe(rev())
.pipe(gulp.dest('public/build'))
.pipe(rev.manifest())
.pipe(gulp.dest('public/build'));
});
gulp.task('default', ['clean', 'less', 'css', 'lint', 'js', 'rev']);