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

Rejecting / Excluding Files | broccoli-funnel #172

Open
buschtoens opened this issue Aug 1, 2019 · 5 comments
Open

Rejecting / Excluding Files | broccoli-funnel #172

buschtoens opened this issue Aug 1, 2019 · 5 comments

Comments

@buschtoens
Copy link

Now that we have Dependency Tracking #168, this plugin becomes much more interesting for bundler-liker build scenarios, where n files get merged into 1 or fewer than n files.

It would be nice, if broccoli-persistent-filter could add a hook to reject a file from the build (similar to getDestFilePath), removing the need for a subsequent broccoli-funnel.

@stefanpenner
Copy link
Collaborator

stefanpenner commented Aug 2, 2019

And this is specifically to reject/exclude input files right?

If so @SparshithNR's https://github.com/SparshithNR/fs-merger may fit the bill for broccoli-persistent-filter to use, instead of direct this.inputPaths access.

@SparshithNR
Copy link
Contributor

SparshithNR commented Aug 2, 2019

I am trying to integrate the https://github.com/SparshithNR/fs-merger, so that broccoli-persistent-filter will accept n trees/paths as input and process it and put processed files to the output path. This will avoid the funneling/merging multiple trees before sending it as an input to the broccoli-persistent-filter.
Something like

class FileModifier extends BroccoliPlugin {
  constructor(nodes, options = {}) {
     super(nodes, {
        name: options.name,
        annotation: options.annotation,
        persistentOutput: true
      });
}

Here nodes is a list of trees or inputPaths from previous step.

@chriseppstein
Copy link
Contributor

@stefanpenner It seems to me that what is being requested is an option that causes only files processed by the filter to pass through to the output tree. @buschtoens is that sufficient?

@vitch
Copy link

vitch commented May 26, 2020

@chriseppstein @stefanpenner - I've come across this issue as I am just starting to use broccoli-persistent-filter and I have a need to do just that.

I guess I could funnel beforehand but I do want some of the other files to be in the tree/ watched as I need to read from them in processString and include information from them in the output file (I'm still working on it but I'm planning to use setDependencies to help with the caching). So maybe I'll end up funneling after but I'm not sure if that will result in unnecessary work being done?

@chriseppstein
Copy link
Contributor

@vitch Yeah, I think you'd have to funnel after filtering in that case, it's a little extra work, but not a ton (the files are just symlinked).

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

5 participants