index.js 740 B

1234567891011121314151617181920
  1. /**
  2. * Copyright (c) 2015-present, Facebook, Inc.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. 'use strict';
  8. const create = require('./create');
  9. module.exports = function (api, opts) {
  10. // This is similar to how `env` works in Babel:
  11. // https://babeljs.io/docs/usage/babelrc/#env-option
  12. // We are not using `env` because it’s ignored in versions > babel-core@6.10.4:
  13. // https://github.com/babel/babel/issues/4539
  14. // https://github.com/facebook/create-react-app/issues/720
  15. // It’s also nice that we can enforce `NODE_ENV` being specified.
  16. const env = process.env.BABEL_ENV || process.env.NODE_ENV;
  17. return create(api, opts, env);
  18. };