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

Feature Request: Provide CLI options via file #284

Closed
ShogunPanda opened this issue Jan 26, 2024 · 0 comments · Fixed by swc-project/pkgs#20
Closed

Feature Request: Provide CLI options via file #284

ShogunPanda opened this issue Jan 26, 2024 · 0 comments · Fixed by swc-project/pkgs#20

Comments

@ShogunPanda
Copy link
Contributor

ShogunPanda commented Jan 26, 2024

Hi!
I often find myself in the need to specify same CLI (note, not the SWC options, the CLI one like --out-dir) options with slight variations (for instance, in production I don't build source-maps).

It would be great if all the options could be specified in a file similar to .swcrc. Ideally the file should be a different one but use the same syntax. As a side idea, we could even use the same .swcrc and open a new section there (like cli).

Is this possible and/or in the roadmap? Would you accept a PR for it?

kdy1 pushed a commit to swc-project/pkgs that referenced this issue Feb 22, 2024
This PR add a new option that can point to JSON file. This file can contain any option supported by CLI (either in `kebab-case` or `camelCase` format) and will applied accordingly.
Other options explicitly provided via command line override the one in the JSON file (so that the file can act as a "template").

Fixes swc-project/cli#284.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant