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

Use deglob instead of recursive readdir #13

Conversation

AlahmadiQ8
Copy link
Contributor

This PR replaces the library recursive-readdir with deglob. The major advantage are the following:

  • deglob respects .gitignore. It will read .gitignore file and ignore all the patterns in there in the result.

That means now when you use the plugin, no need to duplicate ignore patterns in the .gitignore. This is useful since ignoring files in the gitignore is probably most people's use case.

To opt out of using .gitignore, you can pass in the useGitIgnore: false config option.

Example:

    new UnusedWebpackPlugin({
      // Source directories
      directories : [path.join(__dirname, 'src')],
      // Exclude patterns
      exclude     : ["**/__tests__"],
      root : __dirname,
      useGitIgnore: false   // true by default 
    }),

Please let me know what you think :)

@MatthieuLemoine
Copy link
Owner

@AlahmadiQ8 Great idea & nice work!

I've just setup the CI. Can you fix the conflicts ?

@MatthieuLemoine
Copy link
Owner

To pass the CI checks you need to make jest, eslint & prettier happy

@AlahmadiQ8
Copy link
Contributor Author

Thank you so much :)! merge conflicts fixed

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

Successfully merging this pull request may close these issues.

None yet

2 participants