-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
51 lines (44 loc) · 1.24 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
var gulp = require('gulp');
var jsFiles = ['*.js', 'src/**/*.js'];
var jsHint = require('gulp-jshint');
var jscs = require('gulp-jscs');
var nodemon = require('gulp-nodemon');
gulp.task('style', function() {
return gulp.src(jsFiles)
.pipe(jsHint())
.pipe(jsHint.reporter('jshint-stylish', {
verbose: true
}))
.pipe(jscs());
});
gulp.task('inject', function() {
var wiredep = require('wiredep').stream;
var inject = require('gulp-inject');
var injectSrc = gulp.src(['./public/css/*.css', './public/js/*.js'], { read: false });
var injectOptions = {
ignorePath: '/public'
};
var options = {
bowerJson: require('./bower.json'),
directory: './public/lib',
ignorePath: '../../public'
};
return gulp.src('./src/views/*.html')
.pipe(wiredep(options))
.pipe(inject(injectSrc, injectOptions))
.pipe(gulp.dest('./src/views'));
});
gulp.task('serve', ['inject', 'style'], function() {
var options = {
script: 'app.js',
delayTime: 1,
env: {
PORT: 5000
},
watch: jsFiles
};
return nodemon(options)
.on('restart', function(ev) {
console.log('restarting ... ');
});
});