fix(swc): exclude option not processed from cli #6054
Merged
+118
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
First time contributing here. And big thanks too for all the great work.
A Draft that fixes the issue #6009.
Wrote a test too.
I wonder if I didn't miss anything.
From my understanding, it seems the only place where the exclude matching happens is through the
RC.into_config()
method. And inCompiler.read_config()
method. The excluded value fromopts
is not used. And only the one read from files.And i guess adding the bellow in
Compiler.parse_js_as_input()
beforeCompiler.read_config()
:does fix the problem.
If cli options have no
exclude
inconfig
. ortest
, the file would automatically match. Otherwise, the exclude would be run, And then test. And so the condition work in all cases.read_config()
in case.swcrc
contains and exclude that match, would return toNone
. So for that, I run the match before it. And in case of a no matching, I returnedNone
.I run the tests through
cargo test -p swc
they pass well. I didn't test beyond that. Including building and running the binding againstswc/cli
.BREAKING CHANGE:
None.