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: Fine-tuning Terser #6471

Open
aigoncharov opened this issue Feb 20, 2019 · 2 comments
Open

Feature Request: Fine-tuning Terser #6471

aigoncharov opened this issue Feb 20, 2019 · 2 comments

Comments

@aigoncharov
Copy link
Member

aigoncharov commented Feb 20, 2019

Is this a bug report?

No

Proposal:
Support a new environment variable TERSER_CONFIG. A dev could set it to a JSON with config values supported by Terser and CRA would merge default this JSON with its default Terser config.

Example:

  1. Set TERSER_CONFIG to { "keep_classnames": true }
  2. keep_classnames set to true added to Terser options

Reasoning:
Certain libraries rely on class names which are minified by default by Terser. It would be nice to change that without maintaining a fork of CRA for one line of code only.
I'm pretty sure there're other cases as well. Anyway it's pretty simple to add this, it would give developers more freedom, so what's the harm, right? :)

Implementation considerations:
If TERSER_CONFIG environment variable is present, do JSON.parse of its value and add it to Terser options here. Add TERSER_CONFIG to this list.

Would you be willing to accept a PR for this functionality?

@aigoncharov
Copy link
Member Author

aigoncharov commented Feb 25, 2019

@gaearon @Timer @iansu @ianschmitz any thoughts? Would you be willing to merge a PR for this feature if I come up with one?

@stale
Copy link

stale bot commented Mar 28, 2019

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Mar 28, 2019
@stale stale bot removed the stale label Mar 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants