From 9f891331895aa102b7a9471cf7d535c67df2736a Mon Sep 17 00:00:00 2001 From: Adriaan Peeters Date: Fri, 29 May 2020 11:45:38 +0200 Subject: [PATCH 1/2] Bump gulp to 4.0.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 560f750..eb2d061 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "devDependencies": { "chai": "^3.4.1", "codecov": "^1.0.1", - "gulp": "^3.9.0", + "gulp": "^4.0.2", "gulp-uglify": "^2.0.0", "istanbul": "^0.4.2", "mocha": "^3.2.0", From 006c3b87ca89cbca10cf518717335f8cbb732372 Mon Sep 17 00:00:00 2001 From: Adriaan Peeters Date: Fri, 29 May 2020 13:41:34 +0200 Subject: [PATCH 2/2] Gulp 4 uses series instead of an array of task dependencies --- index.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 0c20e25..a7af5ba 100644 --- a/index.js +++ b/index.js @@ -25,7 +25,16 @@ module.exports = function (gulp, processArgv, callbackName) { retrieveArguments )(task); }; - return gulp.task.call(gulp, taskName, taskDependencies || [], wrappedTaskFunction); + + var wrappedFunctionWithDependencies = (function (taskDependencies, wrappedTaskFunction) { + if (Array.isArray(taskDependencies)) { + return gulp.series(taskDependencies, wrappedTaskFunction); + } else { + return wrappedTaskFunction; + } + })(taskDependencies, wrappedTaskFunction); + + return gulp.task.call(gulp, taskName, wrappedFunctionWithDependencies); }; return R.merge(R.clone(gulp), {task: wrappedTask}); };