babel.dev.js 1.37 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
/**
 * Copyright (c) 2015-present, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 */

module.exports = {
11
  // Don't try to find .babelrc because we want to force this configuration.
Dan Abramov's avatar
Dan Abramov committed
12
  babelrc: false,
13
14
  // This is a feature of `babel-loader` for webpack (not Babel itself).
  // It enables caching results in OS temporary directory for faster rebuilds.
15
  cacheDirectory: true,
16
  presets: [
17
18
    // Latest stable ECMAScript features
    require.resolve('babel-preset-latest'),
19
    // JSX, Flow
Dan Abramov's avatar
Dan Abramov committed
20
21
    require.resolve('babel-preset-react')
  ],
22
  plugins: [
23
    // class { handleClick = () => { } }
Dan Abramov's avatar
Dan Abramov committed
24
    require.resolve('babel-plugin-transform-class-properties'),
25
    // { ...todo, completed: true }
Dan Abramov's avatar
Dan Abramov committed
26
    require.resolve('babel-plugin-transform-object-rest-spread'),
27
    // function* () { yield 42; yield 43; }
28
29
30
31
    [require.resolve('babel-plugin-transform-regenerator'), {
      // Async functions are converted to generators by babel-preset-latest
      async: false
    }],
32
    // Polyfills the runtime needed for async/await and generators
Dan Abramov's avatar
Dan Abramov committed
33
34
35
36
37
    [require.resolve('babel-plugin-transform-runtime'), {
      helpers: false,
      polyfill: false,
      regenerator: true
    }]
Dan Abramov's avatar
Dan Abramov committed
38
  ]
39
};