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] Conditional configuration for CLI #516

Open
PinkChampagne17 opened this issue Apr 6, 2024 · 3 comments
Open

[Feature Request] Conditional configuration for CLI #516

PinkChampagne17 opened this issue Apr 6, 2024 · 3 comments

Comments

@PinkChampagne17
Copy link

I've been using bunchee and noticed slight differences in behavior between the CLI and Node.js API, leading to the configuration doesn't meet all my needs.

I propose adding a feature that allows the use of a JS configuration file like other bundlers (maybe another better way), allowing for conditional configuration based on the environment or other conditions.

@huozhi
Copy link
Owner

huozhi commented Apr 6, 2024

Can you share the example of what config you want to set based on the environment. Cause we’re building a zero-config bundler. I don’t want to add a config file to break the original intention of this library

@PinkChampagne17
Copy link
Author

Can you share the example of what config you want to set based on the environment. Cause we’re building a zero-config bundler. I don’t want to add a config file to break the original intention of this library

I want to bundle with minification but except during development. Refer to doc of tsup - Conditional config, which makes it easier to reuse CLI flags in package.json and appropriately adjust based on circumstances

@nnecec
Copy link
Contributor

nnecec commented Apr 24, 2024

You can try this way.

{
  "scripts": {
     "dev": "bunchee -w",
     "build": "bunchee -m"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants