-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
swc-cli: -C "exclude=.*\.spec\.ts" doesn't work from the cli, while it works ok from .swcrc file #6009
Comments
I analyzed the code a bit. To get a better understanding. And basically, it seems the only place where the exclude matching happens is through the And i guess adding the bellow in // adding
if let FileName::Real(ref path) = name {
if !opts.config.matches(path)? {
return Ok(None);
}
}
// before read_config
let config = self.read_config(opts, name)?;
// ..... Should fix that. Before read_config, to avoid reading the configurations. If the file is to be excluded. |
Another question, Why the src files are read before exclusion and matching? bindings/binding_core_node/src/transform.rs#L67 Input::File(ref path) => {
let fm = self.c.cm.load_file(path).context("failed to load file")?;
self.c.process_js_file(fm, handler, &options)
} |
Here a draft PR #6054 |
- fix the problem with exclude not working in the cli as per the ISSUE that i created swc-project/swc#6009. And the FIX that i contributed PR swc-project/swc#6054.
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Describe the bug
Doesn't work.
While
exclude: [".*.spec.ts$"]
works if used in.swcrc
.Expected behavior
Should work just like it does with
.swcrc
Version
@swc/cli: 0.1.57, @swc/core: 1.3.1
The text was updated successfully, but these errors were encountered: