forked from philhawksworth/hawksworx.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
62 lines (51 loc) · 1.25 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
const gulp = require("gulp");
const uglify = require('gulp-uglify');
const concat = require('gulp-concat');
const postcss = require('gulp-postcss');
const tailwindcss = require('tailwindcss');
/*
generate the css with tailwindcss
*/
gulp.task('css', function () {
return gulp.src('src/css/styles.css')
.pipe(postcss([
tailwindcss('./src/css/tailwind.js'),
require('autoprefixer'),
]))
.pipe(gulp.dest('./src/site/css'));
});
/*
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('hawksworx.js'))
.pipe(uglify())
.pipe(gulp.dest('./src/site/_includes/js'));
});
/*
Watch folders for changess
*/
gulp.task("watch", function() {
gulp.watch('./src/css/**/*.css', gulp.parallel('css'));
gulp.watch('./src/js/**/*.js', gulp.parallel('js'));
});
/*
Let's build this sucker.
*/
gulp.task('build', gulp.parallel(
'css',
'js'
));