2021-11-24 15:42:38 +03:00
|
|
|
module.exports = (api) => {
|
|
|
|
const isTest = api.env("test");
|
|
|
|
|
2021-11-25 15:30:35 +03:00
|
|
|
const presetEnv = isTest
|
|
|
|
? ["@babel/preset-env", { targets: { node: "current" } }]
|
|
|
|
: [
|
|
|
|
"@babel/preset-env",
|
|
|
|
{
|
|
|
|
modules: false,
|
|
|
|
loose: true,
|
|
|
|
},
|
|
|
|
];
|
2021-11-24 15:42:38 +03:00
|
|
|
|
|
|
|
return {
|
2021-11-25 15:30:35 +03:00
|
|
|
presets: ["@babel/preset-typescript", presetEnv],
|
2021-11-24 15:42:38 +03:00
|
|
|
plugins: [
|
2022-05-17 13:03:50 +03:00
|
|
|
["@babel/plugin-transform-react-jsx"],
|
2021-11-25 15:30:35 +03:00
|
|
|
"babel-plugin-annotate-pure-calls",
|
2021-11-24 15:42:38 +03:00
|
|
|
],
|
|
|
|
};
|
|
|
|
};
|