-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
42 lines (34 loc) · 1.11 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
var gulp = require('gulp');
var nodemon = require('gulp-nodemon');
//wiredep --it wires bower dependency to your source code
//its like adding script files in index.html
gulp.task('inject', function() {
var wiredep = require('wiredep').stream;
var options = {
directory: 'public/lib',
bowerJson: require('./bower.json'),
ignorePath: '../../public'
}
var gulpInject = require('gulp-inject');//to inject our own css file
var sources = gulp.src(['./public/js/*.js', './public/css/*.css'], {read:false})
var optionInject = {
ignorePath: '/public/'
}
gulp.src('./src/views/*.html')
.pipe(wiredep(options))//plugin is wiredep
.pipe(gulpInject(sources, optionInject))
.pipe(gulp.dest('./src/views'));
});
gulp.task('default',['inject'], function() {//if u name this task something else like default1 than u have to run like gulp <taskname>
nodemon({
script: 'app.js',
ext: 'js',
env: {
PORT:9090
},
ignore:['./node_modules/**','./bower_components/**']
})
.on('restart', function(){
console.log('Server resatrted');
})
});