babel-plugin-module-resolver icon indicating copy to clipboard operation
babel-plugin-module-resolver copied to clipboard

.babelrc BABEL_ENV support not working

Open ThomasLabstep opened this issue 8 years ago • 0 comments

Hello,

Any idea why this is not picking BABEL_ENV ?

.babelrc

{
  "presets": [
    [
      "react-native"
    ]
  ],
  "plugins": [
    [
      "module-resolver",
      {
        "alias": {
          "@state": "./node_modules/state/src",
          "react-native": "./node_modules/react-native"
        },
        "extensions": [
          ".js",
          ".json",
          ".ios.js",
          ".android.js"
        ]
      }
    ]
  ],
  "env": {
    "development": {
      "plugins": [
        [
          "module-resolver",
          {
            "alias": {
              "@state": "../state/src",
              "react-native": "./node_modules/react-native"
            },
            "extensions": [
              ".js",
              ".json",
              ".ios.js",
              ".android.js"
            ]
          }
        ]
      ]
    },
    "production": {
      "plugins": [
        [
          "module-resolver",
          {
            "alias": {
              "@state": "./node_modules/state/src",
              "react-native": "./node_modules/react-native"
            },
            "extensions": [
              ".js",
              ".json",
              ".ios.js",
              ".android.js"
            ]
          }
        ]
      ]
    }
  }
}
BABEL_ENV=development react-native start
BABEL_ENV=production react-native start

What about package.json ? Would be nice to be able to use it too.

Thanks for help!

ThomasLabstep avatar Mar 28 '18 10:03 ThomasLabstep