-
Notifications
You must be signed in to change notification settings - Fork 3
/
babel-options.js
33 lines (31 loc) · 1.36 KB
/
babel-options.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
const utils = require('./utils');
module.exports = {
presets: [
['@babel/preset-env', { targets: '> 0.25%, not dead' }],
['@babel/preset-flow', { all: true }],
['@babel/preset-react', {
"runtime": "automatic"
}],
['@babel/preset-typescript'],
],
plugins: [
['@babel/plugin-proposal-decorators', { 'legacy': true }],
// when building a platform directly, i.e. outside a workspace,
// babel complains loudly and repeatedly that when these modules are enabled:
// * @babel/plugin-proposal-class-properties,
// * @babel/plugin-proposal-private-methods and
// * @babel/plugin-proposal-private-property-in-object
// the "loose" option must be the same for all three.
// but @babel/preset-env sets it to false for ...private-methods.
// overriding it here silences the complaint. STRWEB-12
['@babel/plugin-proposal-class-properties', { 'loose': true }],
['@babel/plugin-proposal-private-methods', { 'loose': true }],
['@babel/plugin-proposal-private-property-in-object', { 'loose': true }],
'@babel/plugin-proposal-export-namespace-from',
'@babel/plugin-proposal-function-sent',
'@babel/plugin-proposal-numeric-separator',
'@babel/plugin-proposal-throw-expressions',
'@babel/plugin-syntax-import-meta',
utils.isDevelopment && require.resolve('react-refresh/babel'),
].filter(Boolean),
};