ColdBox Elixir
v2.x
v2.x
  • Introduction
  • Overview
  • Changelog
  • Installation
  • Running Elixir
  • Configuration Options
  • Working With Stylesheets
  • Working With Scripts
  • Versioning Cache Busting
    • ColdBox Helper Methods
  • Mixing in tasks from ColdBox Modules
  • Copying Files & Directories
  • Deleting Files & Directories
  • Executing Command Line Binaries
  • Calling Gulp Tasks
  • Custom Watchers
  • BrowserSync
  • Vue.js Integration
  • Writing Elixir Extensions
Powered by GitBook
On this page
Edit on Git

Calling Gulp Tasks

If you need to call an existing Gulp task from Elixir, you may use the task method. As an example, imagine that you have a Gulp task that simply speaks a bit of text when called:

gulp.task( 'speak', function() {
    var message = 'Tea...Earl Grey...Hot';

    gulp.src( '' ).pipe( shell( 'say ' + message ) );
});

If you wish to call the speak task from Elixir, use the mix.task method and pass the name of the task as the only argument to the method:

elixir( function( mix ){
    mix.task( 'speak' );
});

Custom Watchers

If you need to register a watcher to run your custom task each time some files are modified, pass a regular expression as the second argument to the task method:

elixir( function( mix ){
    mix.task( 'speak', 'tests/**/*.cfc' );
});
PreviousExecuting Command Line BinariesNextCustom Watchers

Last updated 6 years ago