-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
43 lines (37 loc) · 939 Bytes
/
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
var gulp = require('gulp'),
concat = require('gulp-concat'),
scss = require('gulp-sass'),
connect = require('gulp-connect');
var PATHS = {
BASE: {
CSS: 'app/static/scss/'
},
DEST: {
CSS: 'app/static/css/'
}
};
gulp.task('default', ['css', 'watch', 'connect']);
gulp.task('css', function() {
gulp.src([PATHS.BASE.CSS + '*.scss'])
.pipe(scss({outputStyle: 'compressed'}).on('error', scss.logError))
.pipe(concat('style.css'))
.pipe(gulp.dest(PATHS.DEST.CSS))
.pipe(connect.reload());
});
gulp.task('connect', function() {
connect.server({
root: 'app',
livereload: true
});
});
gulp.task('html', function () {
gulp.src('app/templates/*.html')
.pipe(connect.reload());
});
gulp.task('watch', function() {
gulp.watch([
PATHS.BASE.CSS + '*.scss',
], ['css']);
gulp.watch(['app/templates/*.html'], ['html']);
gulp.watch(['app/templates/**/*.html'], ['html']);
});