UNPKG

657 BJavaScriptView Raw
1/**
2 * Copyright (c) 2013-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 * @format
8 */
9
10'use strict';
11
12const babelRegisterOnly = require('metro-babel-register');
13
14const BABEL_ENABLED_PATHS = ['local-cli'];
15
16/**
17 * Centralized place to register all the directories that need a Babel
18 * transformation before being fed to Node.js. Notably, this is necessary to
19 * support Flow type annotations.
20 */
21function setupBabel() {
22 babelRegisterOnly(
23 babelRegisterOnly.buildRegExps(__dirname, BABEL_ENABLED_PATHS),
24 );
25}
26
27module.exports = setupBabel;