⊗tlGpBsPbT 3 of 14 menu

Public Tasks in Gulp

Let's say we have several tasks:

function taskD(cb) { console.log('taskD'); cb(); } function task1(cb) { console.log('task1'); cb(); } function task2(cb) { console.log('task2'); cb(); }

You can create as many tasks as you want, however, only one task can be the main one - the one we export by default:

exports.default = taskD;

As you already know, such a task can be run via the command line using the following command:

gulp

Other tasks can also be exported:

exports.task1 = task1; exports.task2 = task2;

Exported tasks are called public, as they are created for their subsequent execution via the command line.

In our case, to run the first task in the command line, you need to do the following:

gulp task1

And to run the second task - the following:

gulp task2

Create a task that outputs the current day to the console.

Create a task that outputs the current month to the console.

Create a task that outputs the current year to the console.

Run the created tasks one by one via the command line.

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline