Skip to content

Commit

Permalink
Fix gulpfile
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissy-dev committed Feb 27, 2019
1 parent c61fabf commit a7d6fa3
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions gulpfile.js
Expand Up @@ -5,6 +5,8 @@ const sass = require("gulp-sass");
const babel = require("gulp-babel");
const uglify = require("gulp-uglify");
const del = require("del");
const postcss = require("gulp-postcss");
const tailwindcss = require("tailwindcss");

// Default settings for gulpfile
var project = {
Expand All @@ -26,9 +28,11 @@ gulp.task("watch", done => {
gulp.series("scripts")
);

// Using gulp-watch as standard gulp
// doesn't track files the same way.
// See: https://stackoverflow.com/questions/42890414/how-to-setup-gulp-watch-with-gulp-connect-livereload
/**
Using gulp-watch as standard gulp
doesn't track files the same way.
See: https://stackoverflow.com/questions/42890414/how-to-setup-gulp-watch-with-gulp-connect-livereload
*/
watch(project.buildDest).pipe(connect.reload());

done();
Expand All @@ -53,6 +57,7 @@ gulp.task("stylesheets", done => {
gulp
.src(project.buildSrc + "/assets/stylesheets/app.scss")
.pipe(sass().on("error", sass.logError))
.pipe(postcss([tailwindcss("./tailwind.js"), require("autoprefixer")]))
.pipe(gulp.dest(project.buildSrc + "/_includes/stylesheets"));
done();
});
Expand All @@ -67,13 +72,12 @@ gulp.task("server", done => {
});

// Clean build dir
gulp.task("clean", done => {
del([project.buildDest + "/**/*"]);
done();
gulp.task("clean", function () {
return del([project.buildDest + "/**/*"]);
});

// Build task
gulp.task("build", gulp.series("clean", "stylesheets", "scripts"));
gulp.task("build", gulp.parallel("clean", "stylesheets", "scripts"));

// Development task
gulp.task("dev", gulp.parallel("watch", "stylesheets", "scripts", "server"));

0 comments on commit a7d6fa3

Please sign in to comment.