Skip to content

Adding a new task

Ashley Gibson edited this page Jan 30, 2026 · 2 revisions

Adding a new task requires two changes:

  1. Creating your new task file.
  2. Updating gulpfile.js to export your task file.

New task file

Add a new JavaScript file in the tasks folder. The name of the file should match the new task name as closely as possible. For example: tasks/mynewtask.js

Here's an example file:

// define your task
const myNewTask = (done) => {
    // perform your task here

    // make sure you have a return statement
    return Promise.resolve()
}

// if necessary, customize the display name
myNewTask.displayName = 'task:new' // necessary if you want colons or hyphens in the actual task command

// export
export {
    myNewTask
}

Gulpfile changes

Update the gulpfile.js to add your task file to the list of task exports at the bottom:

/************** Task Exports */

export * from './tasks/build.js'
export * from './tasks/bump.js'
+ export * from './tasks/mynewtask.js'

Clone this wiki locally