Execute gulp4 task on cordova hook

40 views Asked by At

Recently I upgraded to nodejs 12, that required me to upgrade to gulp4. The upgrade was a must so I cannot downgrade.

Now, my cordova hook does not execute the gulp task.

Previously I executed it as:

gulp.start('build');

Now, gulp.start is no longer included in gulp4, gulp.series, gulp.parallel, gulp.task do not work either...

How can I call my task from my hook?

My hook file looks like this:

#!/usr/bin/env node

'use strict';

var gulp = require('gulp');

function hook() {
    process.stdout.write('Running gulp build task');

    require('../gulpfile.js');
    //interaction
    gulp.start('build');
}

module.exports = hook;

The gulp task is defined in gulpfile.js and is defined as:

gulp.task('build', gulp.series(['moveBrandingFiles', 'webpack-task', 'sass', 'index']));

If I manually execute gulp build it will work.

0

There are 0 answers