Gulp tasks
The Aurelia CLI leverages Gulp as its task runner, providing a series of predefined tasks to streamline your development process. These tasks are located in the aurelia_project/tasks directory.
Task Execution
Tasks can be executed using the au command. For example:
Build the application:
au buildExecutes the Gulp task exported from
aurelia_project/tasks/build.js.Run tests:
au testExecutes the task from
aurelia_project/tasks/test.js.
Note: The CLI executes the task exported as default. You can export multiple tasks from a single file:
let task1 = () => {};
let task2 = () => {};
export { task1 as default, task2 };Executing the above using au task1 will run task1.
Creating a New Task
You can create custom tasks to extend the CLI's functionality:
Create a new file: Add a
.jsor.tsfile in theaurelia_project/tasksdirectory.Export the task function:
Run the task: Use
au myCustomTaskto execute it.
Task Metadata
To integrate custom tasks with the CLI help system, define task metadata in a .json file with the same name as the task. For example, for build.js, create build.json:
Last updated
Was this helpful?