Interface ITaskComponents

{@link http://gruntjs.com/api/grunt.task}

Hierarchy

Index

Methods

Methods

public loadNpmTasks(pluginName: string)

Load tasks from the specified Grunt plugin. This plugin must be installed locally via npm, and must be relative to the Gruntfile. Grunt plugins can be created by using the grunt-init gruntplugin template: grunt init:gruntplugin.

Parameters

  • pluginName: string

public loadTasks(tasksPath: string)

Load task-related files from the specified directory, relative to the Gruntfile. This method can be used to load task-related files from a local Grunt plugin by specifying the path to that plugin's "tasks" subdirectory.

Parameters

  • tasksPath: string

public registerMultiTask(taskName: string, taskFunction: Function)

Register a "multi task." A multi task is a task that implicitly iterates over all of its named sub-properties (AKA targets) if no target was specified. In addition to the default properties and methods, extra multi task-specific properties are available inside the task function as properties of the this object.

note

taskFunction.apply(scope: grunt.task.IMultiTask, args: any[])

Parameters

  • taskName: string
  • taskFunction: Function

public registerMultiTask(taskName: string, taskDescription: string, taskFunction: Function)

Parameters

  • taskName: string
  • taskDescription: string
  • taskFunction: Function

public registerTask(taskName: string, taskList: Array<string>)

If a task list is specified, the new task will be an alias for one or more other tasks. Whenever this "alias task" is run, every specified task in taskList will be run, in the order specified. The taskList argument must be an array of tasks.

Parameters

  • taskName: string
  • taskList: Array<string>

public registerTask(taskName: string, description: string, taskFunction: Function)

If a description and taskFunction are passed, the specified function will be executed whenever the task is run.

In addition, the specified description will be shown when grunt --help is run. Task-specific properties and methods are available inside the task function as properties of the this object. The task function can return false to indicate that the task has failed.

note

taskFunction.apply(scope: grunt.task.ITask, args: any[])

Parameters

  • taskName: string
  • description: string
  • taskFunction: Function