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

Allow to configure any options of babel-preset-env #1415

Closed
wants to merge 1 commit into from

Conversation

sheerun
Copy link
Contributor

@sheerun sheerun commented Jan 19, 2017

This change allows to pass any options from babel-preset-env, for example:

{
  "presets": [
    ["react-app", {
      "targets": {
        "chrome": 52,
        "browsers": "last 2 safari versions"
      },
      "loose": true,
      "modules": false
    }]
  ]
}

@rgdelato
Copy link

rgdelato commented Jan 27, 2017

Repeating this in the pull request as well:

@Timer @sheerun

I think it'd be better to do this for all of the included babel presets rather than just for babel-preset-env, so maybe it'd be better if #1415 placed its corresponding config underneath an env key to allow for other preset configurations, like this:

{
  "presets": [
    ["react-app", {
      "env": {
        "targets": {
          "chrome": 52,
          "browsers": "last 2 safari versions"
        },
        "loose": true,
        "modules": false
      },
      "some-other-preset": {
        "some-other-preset-setting": true
      }
    }]
  ]
}

@sheerun
Copy link
Contributor Author

sheerun commented Jan 29, 2017

I can change this, but only if one of committers agree.

Personally I think configuring this one is most important.

@gaearon
Copy link
Contributor

gaearon commented Jan 30, 2017

Sorry, I’m a bit overwhelmed by React work right now, and it’ll take me some time to come back to this and decide.

@gaearon
Copy link
Contributor

gaearon commented Feb 9, 2017

I would like to keep the Babel preset very strict right now to prevent combinatorial explosion of potential options (and thus issues reported). We will definitely support passing the browsers in the future, but this will be a part of #1249. Closing for now.

@mgcrea
Copy link

mgcrea commented Aug 22, 2017

Any chance to have more options than only browsers? I've detailed a use-case for exposing the modules option in #2985.

@lock lock bot locked and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants