UNPKG

1.47 kBJavaScriptView Raw
1'use strict';
2
3/**
4 * Copyright (c) 2015-present, Facebook, Inc.
5 * All rights reserved.
6 *
7 * This source code is licensed under the BSD-style license found in the
8 * LICENSE file in the root directory of this source tree. An additional grant
9 * of patent rights can be found in the PATENTS file in the same directory.
10 */
11
12module.exports = {
13 // Don't try to find .babelrc because we want to force this configuration.
14 babelrc: false,
15 presets: [
16 // let, const, destructuring, classes, modules
17 require.resolve('babel-preset-es2015'),
18 // exponentiation
19 require.resolve('babel-preset-es2016'),
20 // JSX, Flow
21 require.resolve('babel-preset-react')],
22 plugins: [
23 // function x(a, b, c,) { }
24 require.resolve('babel-plugin-syntax-trailing-function-commas'),
25 // await fetch()
26 require.resolve('babel-plugin-syntax-async-functions'),
27 // class { handleClick = () => { } }
28 require.resolve('babel-plugin-transform-class-properties'),
29 // { ...todo, completed: true }
30 require.resolve('babel-plugin-transform-object-rest-spread'),
31 // function* () { yield 42; yield 43; }
32 require.resolve('babel-plugin-transform-regenerator'),
33 // Polyfills the runtime needed for async/await and generators
34 [require.resolve('babel-plugin-transform-runtime'), {
35 helpers: true,
36 polyfill: true,
37 regenerator: true
38 }],
39 // Optimization: hoist JSX that never changes out of render()
40 require.resolve('babel-plugin-transform-react-constant-elements')]
41};
\No newline at end of file