-
Notifications
You must be signed in to change notification settings - Fork 0
/
babel.config.cjs
35 lines (35 loc) · 1.18 KB
/
babel.config.cjs
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
module.exports = {
'assumptions': {
'setPublicClassFields': true,
},
exclude: [
'node_modules/core-js/**',
],
plugins: [
'@babel/plugin-proposal-object-rest-spread',
['@babel/plugin-transform-typescript', {'allowDeclareFields': true}],
['@babel/plugin-proposal-decorators', {'decoratorsBeforeExport': true}],
['@babel/plugin-proposal-class-properties'],
],
presets: [
// Enabling Babel to understand TypeScript
'@babel/preset-typescript',
[
// Allows smart transpilation according to target environments
'@babel/preset-env',
{
// Specifying which browser versions you want to transpile down to
corejs: '3.26.1',
useBuiltIns: 'usage',
bugfixes: true,
/**
* Specifying what module type should the output be in.
* For test cases, we transpile all the way down to commonjs since jest does not understand TypeScript.
* For all other cases, we don't transform since we want Webpack to do that in order for it to do
* dead code elimination (tree shaking) and intelligently select what all to add to the bundle.
*/
modules: false,
},
],
],
};