Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

file exclude option (as array)#19

Open
dgrdl wants to merge 1 commit into
CREEATION:masterfrom
dgrdl:master
Open

file exclude option (as array)#19
dgrdl wants to merge 1 commit into
CREEATION:masterfrom
dgrdl:master

Conversation

@dgrdl

@dgrdl dgrdl commented Apr 11, 2016

Copy link
Copy Markdown

No description provided.

@CREEATION

Copy link
Copy Markdown
Owner

@Qakulukiam Thank you! I'll merge this in later and update the readme etc. accordingly. 👍

@lazytyper

Copy link
Copy Markdown
Collaborator

I've been testing the update. Well, there is one little problem with gulp watch:

if you put the mixin files into the ignore list, and modify a mixin file, it will NOT recompile all affected files. So you need to have to stop it, run gulp jade, and start gulp watch again. Or run gulp jade in another terminal.

I'm also thinking of another solution: Allowing to pass an array to the search option:

var gulp_src, gulp_src_watch;
if(Array.isArray(options.search)) {
    gulp_src = [];
    gulp_src_watch = [];
    options.search.forEach(function(search) {
        if(search.slice(0,1)!=='!') {
            var s = options.baseDir + options.src + search;
            gulp_src.push(s);
            gulp_src_watch.push(s);
        } else {
            gulp_src.push('!' + options.baseDir + options.src + search.substr(1));
        }
    });
} else {
    gulp_src = gulp_src_watch = options.baseDir + options.src + options.search;
}

With this version, you can specify more than on path + ignored paths/file in one array (starting with !), for example.

var options = {
   ...
      search: ['**/*.jade', '!mixins/*'],
   ...
}

But the gulp-watch-Problem still exists there, too. I've pushed the code into a branch issue17.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants