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

preset-env:forceAllTransforms’ description is tautology #2247

Open
dilyanpalauzov opened this issue May 13, 2020 · 3 comments
Open

preset-env:forceAllTransforms’ description is tautology #2247

dilyanpalauzov opened this issue May 13, 2020 · 3 comments

Comments

@dilyanpalauzov
Copy link

https://babeljs.io/docs/en/babel-preset-env#forcealltransforms says:

forceAllTransforms
boolean, defaults to false,
By default, this preset will run all the transforms needed for the targeted environment(s). Enable this option if you want to force running all transforms, which is useful if the output will be run through UglifyJS or an environment that only supports ES5.

This means: by default (forcealltransforms is false) all transform will run. If the default is toggled (forcealltransforms is true), then all transforms will be run.

I see no difference when forceAllTransforms is true and when forceAllTransforms is false.

@babel-bot
Copy link
Contributor

Hey @dilyanpalauzov! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community
that typically always has someone willing to help. You can sign-up here
for an invite.

@nicolo-ribaudo
Copy link
Member

The default behavior is

By default, this preset will run all the transforms needed for the targeted environment

When the option is enabled,

Enable this option if you want to force running all transforms

For example, if your target environment is Chrome, the classes transform will to be enable because it's not needed. However, if you enable forceAllTransform, classes will be transformed.

@dilyanpalauzov
Copy link
Author

dilyanpalauzov commented May 13, 2020

“by default” means what will happen, if the option is not explicitly provided.

The documentation says, that the default value is false and by default, the preset will run all transforms

This means, that when the option is absent, or is set to false, all transforms will run.

For example, if your target environment is Chrome, the classes transform will to be enable because it's not needed.

If the target is Chrome, and the classes transform are not needed:

  1. will the classes-transform be run when forceAllTransforms is absent,
  2. will the classes-transform be run with forceAllTransforms: true,
  3. will the classes-transform be run with forceAllTransforms: false?

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