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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom flags passed to rollup #1661

Closed
joeljeske opened this issue Feb 21, 2020 · 4 comments
Closed

Support custom flags passed to rollup #1661

joeljeske opened this issue Feb 21, 2020 · 4 comments

Comments

@joeljeske
Copy link
Contributor

馃殌 feature request

Relevant Rules

rollup_bundle

Description

A clear and concise description of the problem or missing capability...

It would be useful to allow extra flags to be passed to the rollup binary. Specifically, I want to be able to pass "--silent" to allow bazel to keep a pretty CLI output, but I think it would be useful to allow arbitrary args passed through to support the rest of Rollups API.

Describe the solution you'd like

If you have a solution in mind, please describe it.

Add rule attr

args: [ ]

to the rule rolllup_bundle

Describe alternatives you've considered

Have you considered any alternative solutions or workarounds?

Overriding the rollup tool attr for rollup bundle to set the proc arg before passing on to rollup. Seems a bit overkill

@alexeagle
Copy link
Collaborator

Seems reasonable to me. But we already have an attribute corresponding to a bunch of flags, like sourcemap - if we introduced args would we still keep the sourcemap attribute? Want to be consistent about it

@joeljeske
Copy link
Contributor Author

That鈥檚 a good point. I think it would be nice to support override flags but I agree it could be confusing. I think the best experience would be to support every rollup flag as an attr but it could be difficult to keep up to date with rollup.

Comparing to ts_library, we support some options from tsconfig but others are not respected. Would it be so bad to included a set of override args in addition to the current attrs?

@gregmagolan
Copy link
Collaborator

I'm leaning towards a generic args so that users can override config values from their config file if they want to and also adds support for any args that are not available in config files such as --silent and --environment.

@josephperrott checked and rollup will error out if there are duplicate args so if a user would to add --format it would fail.

In general, however, that would be up to the underlying tool to either handle duplicate CLI args or error out. Should we in general allow users to pass whatever args they want to tools that Bazel invokes?

@joeljeske
Copy link
Contributor Author

Seems like this is fixed as part of #1681

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

No branches or pull requests

3 participants