rules_swc
rules_swc copied to clipboard
[FR]: Support setting a default file extension
What is the current behavior?
Currently rules_swc
defaults to js
unless you have file types mts
, mjs
, cts
, cjs
. This means that you can't customize the file extension type out easily without doing a bunch of list comprehension. There are cases where you may not have individual files, so having the ability to just ask the rule to produce a different extension would be nice.
Describe the feature
Support passing something like
default_ext = ".cjs",
to the swc_compile
rule such that it renames all the files created on your behalf without the need for js_outs
We wrote a patch for this internally and would happily contrib it upstream if the maintainers are open to it.