-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
58 lines (51 loc) · 1.15 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
'use strict';
var gulp = require('gulp');
var exec = require('gulp-exec');
var less = require('gulp-less');
var jshint = require('gulp-jshint');
/**
* Configuration: paths to scrips and resources.
*/
var paths = {
client: ['src/app/*.js', 'src/app/**/*.js'],
styles: ['src/resources/css']
};
/**
* Compiles .less files.
*/
gulp.task('less', function () {
return gulp.src('src/resources/css/*.less')
.pipe(less({
paths: paths.styles
}))
.pipe(gulp.dest('src/resources/css/'));
});
/**
* Performs a JSHint code evaluation.
*/
gulp.task('lint', function () {
return gulp.src(paths.client)
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'));
});
/**
* Serves our Node server.
*/
gulp.task('serve', function () {
gulp.src('./')
.pipe(exec('node app.js'));
});
/**
* Task:
* - initiates 'serve' and reloads changes.
* - bundles above tasks.
*/
gulp.task('start', ['serve', 'less', 'lint'], function () {
// add additional config
});
/**
* Default startup task.
*/
gulp.task('default', ['start']);