Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crawl option ignored #14

Open
ScottSmith95 opened this issue Apr 28, 2015 · 2 comments
Open

Crawl option ignored #14

ScottSmith95 opened this issue Apr 28, 2015 · 2 comments

Comments

@ScottSmith95
Copy link

When using customizr with the gulp-modernizr wrapper, with the following config, the crawl option is ignored. The tests customizr crawls for are then added to the output file, which is not intended.

Gulp configuration

gulp.task('modernizr', function() {
    gulp.src('scripts/*.js').pipe(modernizr({
        cache:   true,
        dest:    'scripts/src/modernizr.js',
        options: ['mq', 'html5printshiv'],
        tests:   ['csstransforms', 'flexbox', 'inlinesvg', 'touchevents'],
        crawl:   false
    }))
    .pipe(gulp.dest('scripts/src/'));
});

Terminal output:

>> Explicitly including these tests:
>> csstransforms, flexbox, inlinesvg, touchevents

Looking for Modernizr references

>> 3 matches in /Users/Scott/Documents/web/Decode/Decode/scripts/decode.js
>> contains, supports, target

No config or test changes detected
>> The build step has been bypassed. Use `--force` to override.
>> Your current file can be found in scripts/src/modernizr.js
@jtwebb
Copy link
Contributor

jtwebb commented Apr 30, 2015

I was having the same issue and it was driving me nuts. I finally figured out what was going on. The issue is really in the gulp-modernizr package. In the index.js file it explicitly sets crawl to false on line 28 saying that gulp is providing the files.

That led me to play with the gulp.src('files here'). And sure enough, whatever file you have in the src is going to be crawled. It's like setting crawl: false and then setting files.src[] to the files that you have in gulp.src. And as the customizr docs say, adding files.src will look at those files and override the crawl option.

I hope I explained that well enough. If not, let me know and I'll try to clarify.

@Tokimon
Copy link

Tokimon commented Oct 13, 2015

isn't that a little contradicting?
Setting the crawl: false should ensure that you do don't crawl anything fx. if you want to disable it momentarily. But maybe that is just my logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants