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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(swc/cli): implements few compile flags #4125

Merged
merged 2 commits into from
Mar 23, 2022

Conversation

kwonoj
Copy link
Member

@kwonoj kwonoj commented Mar 22, 2022

Description:

Update few more flags for the compile command.

Related issue (if exists):

#4017

@kwonoj
Copy link
Member Author

kwonoj commented Mar 22, 2022

Side note, I haven't thought deeply but implementing config seems non trivial work since we can't dynamically access rust struct's property with string key indexer as if we did in js object. I spent some time for it, and trying couple of approaches to make it work.

let config_file = if let Some(config_file_path) = &self.config_file {
let config_file_contents = fs::read(config_file_path)?;
serde_json::from_slice(&config_file_contents)
.map_err(|e| anyhow::anyhow!("{}", e))
Copy link
Member

@kdy1 kdy1 Mar 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this required?
I think .context("message") is enough to convert an error to anyhow::Error

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, looks like old oversight.

@kwonoj kwonoj force-pushed the feat-impl-compile-commands branch from 25f1e0a to 00b740f Compare March 23, 2022 07:18
Copy link
Member

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!


swc-bump:

  • swc_cli

@kdy1 kdy1 enabled auto-merge (squash) March 23, 2022 07:20
@kdy1 kdy1 added this to the v1.2.161 milestone Mar 23, 2022
@kdy1 kdy1 merged commit a6f39d3 into swc-project:main Mar 23, 2022
@kwonoj kwonoj deleted the feat-impl-compile-commands branch March 24, 2022 01:09
@swc-project swc-project locked as resolved and limited conversation to collaborators Oct 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants