Skip to content

Instantly share code, notes, and snippets.

@randomor
Last active August 29, 2015 14:07
Show Gist options
  • Save randomor/0c5f0506d86e7817c3b0 to your computer and use it in GitHub Desktop.
Save randomor/0c5f0506d86e7817c3b0 to your computer and use it in GitHub Desktop.
For using gulp-include with laravel-elixir
//Currently I'm creating the processed coffee file in a temporary directory inside `resources/assets/coffee` for it to be picked up by `mix.coffee`
//And this task also doesn't work for js, scss or css, even though elixir does provide some native support for `@import`.
//Alternative ways of integrate `gulp-include` with `laravel-elixir` is thus deeply appreciated.
elixir.extend('includeFiles', function(src, output) {
var baseDir = this.preprocessors.baseDir + 'coffee/';
src = this.buildGulpSrc(src, baseDir, '**/*.coffee');
gulp.task('include', function() {
return gulp.src(src)
.pipe(include())
.pipe(gulp.dest(output || 'resources/assets/coffee/processed'));
});
this.registerWatcher('include', baseDir + '/**/*');
return this.queueTask('include');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment