-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
41 lines (32 loc) · 1.07 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
var gulp = require('gulp'),
gulpWatch = require('gulp-watch'),
gulpSass = require('gulp-sass'),
gulpJshint = require('gulp-jshint'),
chalk = require('chalk');
function sassTask() {
gulp.src('./ui/scss/**/main.scss')
.pipe(gulpSass())
.on('error', function () {
console.log(chalk.bgRed.white.bold("SASS Compilation Error"));
})
.pipe(gulp.dest('./ui/dist/'));
console.log(chalk.bgGreen.white.bold("SASS Compilation Done ---"));
}
gulp.task('sass', sassTask);
gulp.task('sass-watch', function () {
sassTask();
gulpWatch('./ui/scss/**/*.scss', sassTask);
});
function jshintTask() {
gulp.src(['./ui/**/*.js', 'main.js', 'gulpfile.js'])
.pipe(gulpJshint())
.pipe(gulpJshint.reporter('jshint-stylish'))
.pipe(gulp.dest('./ui/dist/'));
console.log(chalk.bgGreen.white.bold('JS Hint Done ---'));
}
gulp.task('jshint', jshintTask);
gulp.task('jshint-watch', function () {
jshintTask();
gulpWatch(['./ui/**/*.js', 'main.js', 'gulpfile.js']);
});
gulp.task('build', ['sass', 'jshint']);