-
Notifications
You must be signed in to change notification settings - Fork 5
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 certain files from being copied #4
Comments
Hi, If you were to re-implement the filter function what would it look like? |
What I'd prefer to do is something along the lines of...
|
Otherwise, to cover my use case, I'd end up duplicating all of your |
Yes - I think this would be an excellent addition - exporting the |
Ha, I'm actually looking into re-using the |
Yep! Feel free to open a PR if you want to arrive at a solution that lets you:
|
I've been using this plugin for a month now to simplify publishing static files into the resulting build and I'm pleased with it so far. Due to some quirks in the project I'm working on, I need to exclude certain files from being copied.
While I know I can override the filter function as an optional argument, it would require me to re-implement the entire logic of filter function which seems a bit excessive.
I can spin up a PR to add this functionality but I'm looking for guidance for the best way to implement this...
My thoughts are I could take one of the following approaches:
Add a new
exclude
argument to the options object and have the built-infilter
function evaluate that when it's called (e.g. if source file name with leading directory stripped matches an element in the excluded array, then return false).Export the
filter
function to allow it to be reused externally, then one doesn't have to choose between your filter logic and their filter logic.The problem I see with option 1 is this would make the API and documentation a bit clunky since it requires a caveat in giant bold letters that
exclude
will be ignored if thefilter
function is overridden.Whether option 2 is palatable is up to you and your preferences.
What are your thoughts?
The text was updated successfully, but these errors were encountered: