UNPKG

1.14 kBJavaScriptView Raw
1module.exports = {
2 // Don't try to find .babelrc because we want to force this configuration.
3 babelrc: false,
4 presets: [
5 // let, const, destructuring, classes, modules
6 require.resolve('babel-preset-es2015'),
7 // exponentiation
8 require.resolve('babel-preset-es2016'),
9 // JSX, Flow
10 require.resolve('babel-preset-react')
11 ],
12 plugins: [
13 // function x(a, b, c,) { }
14 require.resolve('babel-plugin-syntax-trailing-function-commas'),
15 // await fetch()
16 require.resolve('babel-plugin-syntax-async-functions'),
17 // class { handleClick = () => { } }
18 require.resolve('babel-plugin-transform-class-properties'),
19 // { ...todo, completed: true }
20 require.resolve('babel-plugin-transform-object-rest-spread'),
21 // function* () { yield 42; yield 43; }
22 require.resolve('babel-plugin-transform-regenerator'),
23 // Polyfills the runtime needed for async/await and generators
24 [require.resolve('babel-plugin-transform-runtime'), {
25 helpers: false,
26 polyfill: false,
27 regenerator: true
28 }],
29 // Optimization: hoist JSX that never changes out of render()
30 require.resolve('babel-plugin-transform-react-constant-elements')
31 ]
32};
\No newline at end of file