The basic process for extending Elixir is pretty easy. Here's an example of a 'move' task that simply accepts an array of files, and moves them all to a destination directory.
elixir.extend('files', function(src, output) {
gulp.task('move', function() {
gulp.src(src).pipe(gulp.dest(output));
});
return this.queueTask('move');
});
This allows you to do:
elixir(function(mix) {
mix.files('foo.txt', 'dest');
});
To set this up, you could either include a file that contains your custom tasks...
// Gulpfile.js
var elixir = require('laravel-elixir');
require('./my-tasks');
Or, you could even create an npm module, so that others can use it by doing:
npm install laravel-elixir-stylus --save-dev
In fact, that Stylus extension already exists. So, if you grab that, you can use it, like so:
var elixir = require('laravel-elixir');
require('laravel-elixir-stylus');
elixir(function(mix) {
mix.stylus("main.styl");
});