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

Exclude files matching ignore patterns (fixes #71) #79

Conversation

dcalhoun
Copy link

@dcalhoun dcalhoun commented Mar 5, 2017

Do not run the loader against file paths matching ignore patterns within the StandardJS package config.

Do not run the loader against file paths matching ignore patterns within
the StandardJS [package config](https://github.com/feross/standard/tree/v10.0.0-beta.0#how-do-i-ignore-files).
@timoxley
Copy link
Contributor

timoxley commented Mar 6, 2017

Do you think maybe a less magical way to do would be to explicitly use webpack's exclude field when configuring the package, and read the standard.ignore directly from the package.json? e.g.

const pkg = require('./package.json')
// ...
{
// ...
        {
        test: /\.jsx?$/,
        loader: 'standard-loader',
        exclude: pkg.standard.ignore
      }
}
// ...

One concern I have with this PR and my suggestion is that neither guarantee the exact same matching algorithm used by the standard package i.e. webpack's exclude, minimatch and standard's ignore could all use slightly different matching algorithms. For simple globs this probably doesn't matter, but for more esoteric patterns it's quite possible that different files would be silently excluded/included. I'm not sure a good way around that though.

@dcalhoun
Copy link
Author

dcalhoun commented Mar 7, 2017

I could be wrong, but I believe the webpack loader exclude utilizes regex and StandardJS' ignore relies on globs. So, I don't think we could merely copy the package.json config into the loader exclude. I will test that theory, though.

If you feel like this is a feature that should not be included at all, that is fine. However, it would've been helpful to receive that feedback in #71. ☹️

P.S. – I do not know why the tests fail in the CI. They are passing locally for me. I'll try to get them passing.

@dcalhoun
Copy link
Author

dcalhoun commented May 5, 2017

@timoxley I looked into it a bit more and the two libraries do, in fact, use completely different methods for matching patterns. StandaredJS uses deglob and webpack utilizes RegEx. So, I see no way to share the configuration by passing it directly.

That said, I'm going to close this PR. It is now out-of-date and my use case doesn't appear to be one that aligns with the project. Thanks for considering and publishing the project.

@dcalhoun dcalhoun closed this May 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants