CREEATION / laravel-elixir-jade

Simple Laravel Elixir wrapper to compile Jade Templates to Blade/PHP.
MIT License
36 stars 11 forks source link

Allow to exclude jade files #17

Open benjdl opened 8 years ago

benjdl commented 8 years ago

Hello, thanks for your great plugin!

It would be great if we could exclude a jade file from the pipe, I mean for example the mixins files which didn't have to be compiled into a blade file.

CREEATION commented 8 years ago

Hey @benjdl,

I'll look into this as soon as possible, as I don't use Laravel anymore. Thanks for reporting. :)

dgrdl commented 8 years ago

I had the same issue and solved it by adding:

exclude: []

as an option and updating the gulp_src as follows:

var gulp_src = [options.baseDir + options.src + options.search];

for (var files of options.exclude) {
  gulp_src.push('!' + options.baseDir + options.src + files);
}

Then you can just do this in your gulpfile for example:

mix.jade({
  exclude: ['mixins/*.jade']
});

This can probably be improved, but it worked out for me.

CREEATION commented 8 years ago

@Qakulukiam Cool! @benjdl Can you check if this works for you? I can't find the time to setup Laravel etc. so I can't really test this.

benjdl commented 8 years ago

@Qakulukiam @CREEATION Works like a charm! ;)

dgrdl commented 8 years ago

19 sent pull request for this enhancement