From 864ef13a2ab27e37a5006273dd76a410bbd4a868 Mon Sep 17 00:00:00 2001 From: Miodec Date: Mon, 7 Feb 2022 18:44:45 +0100 Subject: [PATCH] sped up local develpment workflow only needed tasks will be ran on file save - lint js on js and browserify on save - lint json and static copy on static file save - sass compile on sass save --- gulpfile.js | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 9ef4f2f24..50ca5c469 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -20,9 +20,15 @@ task("clean", function () { return src(["./public/"], { allowEmpty: true }).pipe(vinylPaths(del)); }); -task("lint", function () { - let filelist = ["./src/js/**/*.js", "./static/**/*.json"]; - return src(filelist) +task("lint-js", function () { + return src("./src/js/**/*.js") + .pipe(eslint(eslintConfig)) + .pipe(eslint.format()) + .pipe(eslint.failAfterError()); +}); + +task("lint-json", function () { + return src("./static/**/*.json") .pipe(eslint(eslintConfig)) .pipe(eslint.format()) .pipe(eslint.failAfterError()); @@ -98,11 +104,20 @@ task("updateSwCacheName", function () { task( "compile", - series("lint", "browserify", "static", "sass", "updateSwCacheName") + series( + "lint-js", + "lint-json", + "browserify", + "static", + "sass", + "updateSwCacheName" + ) ); task("watch", function () { - watch(["./static/**/*", "./src/**/*", "gulpfile.js"], series("compile")); + watch("./src/sass/**/*.scss", series("sass")); + watch("./src/js/**/*.js", series("lint-js", "browserify")); + watch("./static/**/*.*", series("lint-json", "static")); }); task("build", series("clean", "compile"));