This repository has been archived by the owner on Oct 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 222
/
babel.config.js
49 lines (48 loc) · 1.55 KB
/
babel.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/** @type {import('@babel/core').TransformOptions} */
module.exports = function (api) {
const envName = api.env();
const development = envName === 'development' || envName === 'test';
return {
presets: [
[
'@babel/preset-env',
{
bugfixes: true,
useBuiltIns: 'entry',
corejs: '3.0',
// Always include these transformations, as we want to maintain
// webpack v4 support for esnext builds until the next major release.
// These syntaxes are not supported in acorn v6 (used by webpack v4),
// so we must transpile them away if we want webpack v4 support
// See https://github.com/webpack/webpack/issues/10227
include: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-private-methods',
'@babel/plugin-proposal-numeric-separator',
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-proposal-optional-chaining',
],
},
],
['@babel/preset-typescript'],
['@babel/preset-react', {development, useBuiltIns: true}],
],
plugins: [],
assumptions: {
setPublicClassFields: true,
privateFieldsAsProperties: true,
},
overrides: [
// Disable useBuiltins and corejs for the polyfills package
{
test: 'packages/polyfills',
presets: [
[
'@babel/preset-env',
{bugfixes: true, useBuiltIns: false, corejs: false},
],
],
},
],
};
};