-
Notifications
You must be signed in to change notification settings - Fork 7
/
gulpfile.js
40 lines (32 loc) · 930 Bytes
/
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
var gulp = require('gulp');
var path = require('path');
var jshint = require('gulp-jshint');
var less = require('gulp-less');
var connect = require('gulp-connect');
gulp.task('lint', function() {
return gulp.src('./js/*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('less', function () {
gulp.src('./less/*.less')
.pipe(less({
paths: [ path.join(__dirname, 'less', 'includes') ]
}))
.on('error', errorHandler)
.pipe(gulp.dest('./css'));
});
gulp.task('connect', function() {
connect.server({
root: '.'
});
});
var watcher = gulp.watch('./less/*.less', ['less'] );
watcher.on('change', function(event) {
console.log('File ' + event.path + ' was ' + event.type + ', running tasks...');
});
gulp.task('default', function() { ['lint', 'less'] });
function errorHandler (error) {
console.log(error.toString());
this.emit('end');
}