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

Multiple envs: 1 for node, 1 for browsers #6418

Closed
hzoo opened this issue Oct 5, 2017 · 0 comments
Closed

Multiple envs: 1 for node, 1 for browsers #6418

hzoo opened this issue Oct 5, 2017 · 0 comments
Labels
i: question outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: preset-env

Comments

@hzoo
Copy link
Member

hzoo commented Oct 5, 2017


Migrated from babel/babel-preset-env#189
Originally created by @verekia on Mon, 06 Mar 2017 15:58:57 GMT


Let's say we are using Babel on both the back-end with Node and on the front-end with Webpack. What would be the correct way to setup babel-preset-env so that it performs minimal transformations for Node, but more transformations for browsers when building with Webpack?

From my understanding, Babel considers the lowest common denominator, even between different beasts like Node and browsers. Therefore, the following does not work from the tests I've run:

"targets": {
  "node": "current",
  "browsers": "> 1%"
},

What would be your recommendation in such situation? Using 2 different .babelrc files?

Is it something you plan to address in the future?

Thanks

@hzoo hzoo closed this as completed Oct 5, 2017
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label May 4, 2018
@lock lock bot locked as resolved and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
i: question outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: preset-env
Projects
None yet
Development

No branches or pull requests

1 participant