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

How to use it with multiple environments in babel-env? #198

Open
ghost opened this issue Jul 2, 2021 · 0 comments
Open

How to use it with multiple environments in babel-env? #198

ghost opened this issue Jul 2, 2021 · 0 comments

Comments

@ghost
Copy link

ghost commented Jul 2, 2021

My .babelrc has 2 environments that are used for differential serving:

"env": {
  "modern": {
    "presets": [
      [
        "@babel/preset-env",
        {
          "targets": {
            "esmodules": true
          }
        }
      ],
      "@babel/preset-react",
      "@babel/preset-flow"
    ],
    "plugins": [...],
  },
  "legacy": {
    "presets": [
      [
        "@babel/preset-env",
        {
          "targets": {
            "esmodules": false
          }
        }
      ],
      "@babel/preset-react",
      "@babel/preset-flow"
    ],
    "plugins": [...],
  }
}

These can be selected using the BABEL_ENV flag. Since either modern or legacy is selected I can't just add another environment (production) because two environments cannot be selected at the same time.

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

0 participants