Currently rollup_bundle provides various bundle type outputs using OutputGroupInfo, but the default es5.min bundle is always built. When es5.min is not required this adds overhead minifiing the es5 bundle and creating the es5 bundle might also be overhead (if only an es6 version is wanted).
Changing the DefaultInfo of the rollup_bundle rule will prevent this.
Can I try this?
Try what? If you're looking for examples of how to use the existing output groups see: https://github.com/bazelbuild/rules_nodejs/blob/master/internal/e2e/rollup/BUILD.bazel#L41-L87
Sorry for the confusion, I wanted to say, can I work on this issue.
Of I see, sorry I should have understood that :)
I don't think we've 100% decided if changing the default is the best option.
@alexeagle were we ok with changing the default to be a non-production es6 bundle? I'm still not sure about that, but not sure of any other options... :/
That would also force people to use the awkward outputgroup+filegroup API.
ok thanks.
I think the default output should be es2015 non-minified to avoid extra actions being run if not requested.
This also makes it compose better, if you had a standalone terser_minified rule it should look like
terser_minified(name = "min", srcs = [":my_rollup_bundle"])
@jbedard does this play well with your design proposal for refactoring rollup_bundle?
I was debating if we should have any default output. Won't es2015 have the same problem as es5 at some point in the future, then we have to change it again? However if we think that's ok then es2015 would be a reasonable default, but we might want to wait until the API changes to avoid multiple breaking changes?
I was also thinking about extracting the minification into a terser rule like your suggestion.
fixed in f0f7c9db12062c6c7733c9d8b782793e7f630f20
turns out the default files are fine, it was injecting runfiles that caused the action to run unconditionally