-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbabel.config.js
More file actions
31 lines (29 loc) · 1.06 KB
/
babel.config.js
File metadata and controls
31 lines (29 loc) · 1.06 KB
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
// NOTE: this is used by multiple processes, so check all these after making any changes
// 1. yarn dev, yarn build-production
// 2. yarn test (jest test running environment)
// 3. yarn lingui-extract
module.exports = function (api) {
if (api) api.cache(true);
return {
presets: [
"@babel/preset-typescript",
[
// allow ES2015, ES2016 stuff like import
"@babel/preset-env",
{
targets: {
// else we get regeneratorRuntime is not defined
browsers: ["chrome 76"], // should be set to match whatever chromium electron is using. But at 106 (electron 22, babel with webpack 4 has compilation problems)
},
},
],
"@babel/preset-react",
],
plugins: [
"babel-plugin-macros",
"@babel/plugin-transform-modules-commonjs", //https://github.com/facebook/jest/issues/6913#issuecomment-421618932
//playwright can't handle these ["@babel/plugin-proposal-decorators", { legacy: true }],
["@babel/plugin-proposal-class-properties", { loose: false }],
],
};
};