-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
56 lines (47 loc) · 1.28 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
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var jscs = require('gulp-jscs');
var nodemon = require('gulp-nodemon');
var jsFiles = ['*.js', 'src/**/*.js'];
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', ['style', 'inject'], function() {
var options = {
script: 'app.js',
delayTime: 1,
env: {
'PORT': 3000
},
watch: jsFiles
};
return nodemon(options)
.on('restart', function(ev) {
console.log('Restarting...');
});
});