UNPKG

1.51 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 // This is a feature of `babel-loader` for webpack (not Babel itself).
16 // It enables caching results in OS temporary directory for faster rebuilds.
17 cacheDirectory: true,
18 presets: [
19 // let, const, destructuring, classes, modules
20 require.resolve('babel-preset-es2015'),
21 // exponentiation
22 require.resolve('babel-preset-es2016'),
23 // JSX, Flow
24 require.resolve('babel-preset-react')],
25 plugins: [
26 // function x(a, b, c,) { }
27 require.resolve('babel-plugin-syntax-trailing-function-commas'),
28 // await fetch()
29 require.resolve('babel-plugin-syntax-async-functions'),
30 // class { handleClick = () => { } }
31 require.resolve('babel-plugin-transform-class-properties'),
32 // { ...todo, completed: true }
33 require.resolve('babel-plugin-transform-object-rest-spread'),
34 // function* () { yield 42; yield 43; }
35 require.resolve('babel-plugin-transform-regenerator'),
36 // Polyfills the runtime needed for async/await and generators
37 [require.resolve('babel-plugin-transform-runtime'), {
38 helpers: true,
39 polyfill: true,
40 regenerator: true
41 }]]
42};
\No newline at end of file