-
Notifications
You must be signed in to change notification settings - Fork 21
/
gulpfile.js
executable file
·59 lines (47 loc) · 1.48 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
58
59
var gulp = require('gulp'),
concat = require('gulp-concat'),
sass = require('gulp-sass'),
notify = require('gulp-notify');
function swallowError(error) {
this.emit('end');
}
function reportError(error) {
notify.onError().apply(this, arguments);
this.emit('end');
}
// combine js into single file
//===========================================
gulp.task('scripts', function() {
gulp.src([
'./src/js/lib/jquery.min.js',
'./src/js/lib/cssbeautify.js',
'./src/js/lib/specificity.js',
'./src/js/lib/tablesorter.js',
'./src/js/local/helpers.js',
'./src/js/local/syntax-highlight.js',
'./src/js/local/build-html.js',
'./src/js/local/build-specificity.js',
'./src/js/local/button-control.js',
'./src/js/local/css-highlight.js',
'./src/js/local/tabs.js'
])
.pipe(concat('cssdig.js'))
.pipe(gulp.dest('./ext/js/'))
});
// compile sass to css
//===========================================
gulp.task('sass', function () {
gulp.src('assets/sass/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(gulp.dest('ext/css/'));
});
// watch: monitor html and static assets updates
//===========================================
gulp.task('watch', function() {
// watch task for sass
gulp.watch('./assets/sass/**/*.scss', ['sass']);
gulp.watch('./src/js/**/*.js', ['scripts']);
});
// Default Gulp Task
//===========================================
gulp.task('default', ['sass', 'scripts', 'watch']);