2017-01-06 14:02:36 +00:00
|
|
|
/**
|
2018-09-11 22:27:47 +00:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2017-01-06 14:02:36 +00:00
|
|
|
*
|
2018-02-17 02:24:55 +00:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2018-05-11 20:32:37 +00:00
|
|
|
*
|
|
|
|
* @format
|
2017-01-06 14:02:36 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
2018-04-23 10:52:15 +00:00
|
|
|
const babelRegisterOnly = require('metro-babel-register');
|
2017-01-06 14:02:36 +00:00
|
|
|
|
2018-04-23 20:37:19 +00:00
|
|
|
const BABEL_ENABLED_PATHS = ['local-cli'];
|
2017-01-06 14:02:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Centralized place to register all the directories that need a Babel
|
|
|
|
* transformation before being fed to Node.js. Notably, this is necessary to
|
|
|
|
* support Flow type annotations.
|
|
|
|
*/
|
|
|
|
function setupBabel() {
|
2018-05-11 20:32:37 +00:00
|
|
|
babelRegisterOnly(
|
|
|
|
babelRegisterOnly.buildRegExps(__dirname, BABEL_ENABLED_PATHS),
|
|
|
|
);
|
2017-01-06 14:02:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = setupBabel;
|