forked from heroku-examples/node-ws-test
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
48 lines (39 loc) · 1.33 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
var gulp = require('gulp');
var jade = require('gulp-jade');
var nodemon = require('gulp-nodemon');
gulp.task('templates', function() {
var YOUR_LOCALS = {};
gulp.src('./source/*.jade')
.pipe(jade({
locals: YOUR_LOCALS,
pretty: true
}))
.pipe(gulp.dest('./wwwroot/'))
});
gulp.task('develop',['stylesheets', 'scripts', 'templates'], function () {
nodemon({ script: 'app/server.js', watch: ['source/**/*.*']})
.on('restart', function () {
console.log('restarted!')
})
});
gulp.task('stylesheets', function() {
gulp.src('./source/stylesheets/*.css')
.pipe(gulp.dest('./wwwroot/stylesheets/'));
});
gulp.task('images', function() {
gulp.src('./source/images/*.*')
.pipe(gulp.dest('./wwwroot/images/'));
});
gulp.task('scripts', function() {
gulp.src('./source/javascript/*.js')
.pipe(gulp.dest('./wwwroot/javascript/'));
});
gulp.task('watch', function(){
gulp.watch('./source/javascript/*.js', ['scripts']);
gulp.watch('./source/stylesheets/*.css', ['stylesheets']);
gulp.watch('./source/*.jade', ['templates']);
gulp.watch('./source/images/*.*', ['images']);
});
gulp.task('default', ['templates', 'scripts', 'stylesheets', 'images', 'watch', 'develop'], function() {
// place code for your default task here
});