Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/babel.config.js
7382 views
1
module.exports = function (api) {
2
let targets = {};
3
const plugins = [
4
'babel-plugin-macros',
5
'styled-components',
6
'react-hot-loader/babel',
7
'@babel/transform-runtime',
8
'@babel/transform-react-jsx',
9
'@babel/proposal-class-properties',
10
'@babel/proposal-object-rest-spread',
11
'@babel/proposal-optional-chaining',
12
'@babel/proposal-nullish-coalescing-operator',
13
'@babel/syntax-dynamic-import',
14
];
15
16
if (api.env('test')) {
17
targets = { node: 'current' };
18
plugins.push('@babel/transform-modules-commonjs');
19
}
20
21
return {
22
plugins,
23
presets: [
24
'@babel/typescript',
25
['@babel/env', {
26
modules: false,
27
useBuiltIns: 'entry',
28
corejs: 3,
29
targets,
30
}],
31
'@babel/react',
32
]
33
};
34
};
35
36