This repository has been archived by the owner on Jun 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 93
/
gulpfile.js
91 lines (85 loc) · 3.13 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// -----------------------------------------------------------/
// gulpfile.js
// HowdyPro web site
// howdy.ai
// Change Log:
// ** Repaired the gulp watch to reload on changes to js and sass files.
// ** Added livereload plugin to refresh the page in the browser (note: livereload extension needs to be enabled in chrome)
// ** Added gulp task to run unit tests and unit test coverate report per mocha unit test support
// -----------------------------------------------------------/
// -----------------------------------------------------------/
// Dependencies
// -----------------------------------------------------------/
var gulp = require('gulp'),
concat = require('gulp-concat'),
sass = require('gulp-sass'),
gutil = require('gulp-util'),
package = require('./package.json');
var banner = function() {
return '/*! ' + package.name + ' - v' + package.version + ' - ' + gutil.date(new Date(), "yyyy-mm-dd") +
' [copyright: ' + package.copyright + ']' + ' */';
};
function logData() {
gutil.log(
gutil.colors.bgGreen(
gutil.colors.white(
gutil.colors.bold(
gutil.colors.white.apply(this, arguments)
)
)
)
);
}
function ready() {
gutil.log(
gutil.colors.bgMagenta(
gutil.colors.white(
gutil.colors.bold('[ STATUS: READY ]')
)
)
);
}
// -----------------------------------------------------------/
// Get Sassy
// -----------------------------------------------------------/
gulp.task('sass', function() {
logData('Compiling Sass...');
return gulp.src('./sass/*.scss')
.pipe(sass({
outputStyle: 'compressed'
}).on('error', sass.logError))
.pipe(gulp.dest('./public/css/'));
});
// -----------------------------------------------------------/
// Get JSesesussy
// Copy JS files to public scripts distribution folder
// -----------------------------------------------------------/
// copy JS scripts
// gulp.task('copy-js', function() {
// logData('Copying JS assets...');
// return gulp.src([])
// .pipe(gulp.dest('./public/js/'));
// });
// copy partials to public scripts
gulp.task('copy-partials', function() {
logData('Copying HTML partials...');
return gulp.src(['./botkit-scriptui/*.html'])
.pipe(gulp.dest('./public/js/partials/'));
});
// copy partials to public scripts
gulp.task('copy-more-partials', function() {
logData('Copying HTML partials...');
return gulp.src(['./views/partials/*.html'])
.pipe(gulp.dest('./public/partials/'));
});
// concat controllers to public scripts
gulp.task('controller-concat', function() {
logData('Concatenating and Copying Controllers...');
return gulp.src(['./js/*.js', './botkit-scriptui/*.js'])
.pipe(concat('scripts.js'))
.pipe(gulp.dest('./public/js/'));
});
// -----------------------------------------------------------/
// Rebuild all the things
// -----------------------------------------------------------/
gulp.task('default', gulp.series('controller-concat', 'copy-partials','copy-more-partials', 'sass'));