-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulpfile.js
46 lines (39 loc) · 950 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
44
45
46
const gulp = require("gulp");
const sass = require("gulp-sass");
const uglify = require('gulp-uglify');
const concat = require('gulp-concat');
/*
generate the css with sass
*/
gulp.task('css', function() {
return gulp.src('./src/scss/*.scss')
.pipe(sass({
outputStyle: 'compressed'
})
.on('error', sass.logError))
.pipe(gulp.dest('./src/site/_includes/css'));
});
/*
Uglify our javascript files into one.
Use pump to expose errors more usefully.
*/
gulp.task('js', function() {
return gulp.src("./src/js/**/*.js")
.pipe(concat('pensamplivox.js'))
.pipe(uglify())
.pipe(gulp.dest('./src/site/_includes/js'));
});
/*
Watch folders for changess
*/
gulp.task("watch", function() {
gulp.watch('./src/scss/**/*.scss', gulp.parallel('css'));
gulp.watch('./src/js/**/*.js', gulp.parallel('js'));
});
/*
Let's build this sucker.
*/
gulp.task('build', gulp.parallel(
'css',
'js'
));