-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathgulpfile.js
57 lines (47 loc) · 1.41 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
var gulp = require('gulp'),
sass = require('gulp-sass'),
nodemon = require('gulp-nodemon'),
wiredep = require('wiredep').stream,
concat = require('gulp-concat');
gulp.task('js-process', function(){
gulp.src('./app/js/*.js')
.pipe(concat('app.js'))
.pipe(gulp.dest('dist/scripts'));
});
gulp.task('html-process', function(){
gulp.src('./app/**/*.html')
.pipe(gulp.dest('./dist'));
});
gulp.task('css-process', function(){
gulp.src('./app/css/*.css')
.pipe(concat('all.css'))
.pipe(gulp.dest('./dist/css'));
});
gulp.task('sass',function(){
return gulp.src('./app/scss/*.scss')
.pipe(sass())
.pipe(gulp.dest('app/css'));
});
gulp.task('serve', function () {
nodemon({
script : 'server.js',
watch : 'server.js'
//...add nodeArgs: ['--debug=5858'] to debug
//..or nodeArgs: ['--debug-brk=5858'] to debug at server start
});
});
gulp.task('bower-dependencies', function () {
gulp.src('./index.html')
.pipe(wiredep({
directory: './bower_components',
bowerJson: require('./bower.json'),
}))
.pipe(gulp.dest('./dist'));
});
gulp.task('watch',function(){
gulp.watch(['./app/scss/*.scss'], ['sass']);
gulp.watch(['./app/js/*.js'],['js-process']);
gulp.watch(['./app/**/*.html'],['html-process']);
gulp.watch(['./app/css/*.css'],['css-process']);
});
gulp.task('default',['watch','sass','js-process','serve','bower-dependencies','html-process']);