Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant