2024-07-27 10:19:43 +05:00
|
|
|
let PROCESS_ENV = process.env.BABEL_ENV || process.env.NODE_ENV;
|
|
|
|
|
/**
|
|
|
|
|
* @type {import('@babel/core').ConfigFunction}
|
|
|
|
|
*/
|
|
|
|
|
module.exports = function (api, opts) {
|
|
|
|
|
if (!PROCESS_ENV) PROCESS_ENV = 'production';
|
|
|
|
|
|
|
|
|
|
const env = {
|
2025-05-21 11:03:32 +05:00
|
|
|
presets: ['module:@react-native/babel-preset'],
|
2024-07-27 10:19:43 +05:00
|
|
|
plugins: [
|
|
|
|
|
'@babel/plugin-transform-named-capturing-groups-regex',
|
|
|
|
|
'react-native-reanimated/plugin',
|
|
|
|
|
"@babel/plugin-transform-export-namespace-from",
|
2024-10-02 15:29:49 +05:00
|
|
|
["@babel/plugin-transform-private-methods", { "loose": true }]
|
2024-07-27 10:19:43 +05:00
|
|
|
],
|
2024-10-02 15:29:49 +05:00
|
|
|
// overrides: [
|
|
|
|
|
// {
|
|
|
|
|
// test: '../node_modules/@streetwriters/kysely',
|
|
|
|
|
// plugins: [
|
|
|
|
|
// ["@babel/plugin-transform-private-methods", { "loose": true }]
|
|
|
|
|
// ]
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// test: '../node_modules/@streetwriters/kysely',
|
|
|
|
|
// plugins: [
|
|
|
|
|
// ["@babel/plugin-transform-private-methods", { "loose": true }]
|
|
|
|
|
// ]
|
|
|
|
|
// },
|
|
|
|
|
// ]
|
2024-07-27 10:19:43 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (env === 'production') {
|
|
|
|
|
env.plugins.push('transform-remove-console');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (env === 'test') {
|
|
|
|
|
env.overrides.push({
|
|
|
|
|
test: '../node_modules/jest-runner',
|
2022-04-20 02:09:54 +05:00
|
|
|
plugins: [
|
2024-07-27 10:19:43 +05:00
|
|
|
["@babel/plugin-transform-private-methods", { "loose": true }]
|
2022-04-20 02:09:54 +05:00
|
|
|
]
|
2024-07-27 10:19:43 +05:00
|
|
|
})
|
2022-03-09 10:09:45 +05:00
|
|
|
}
|
2024-07-27 10:19:43 +05:00
|
|
|
|
2022-03-09 10:09:45 +05:00
|
|
|
api.cache(true);
|
2024-07-27 10:19:43 +05:00
|
|
|
return env;
|
2019-11-15 01:17:59 +05:00
|
|
|
};
|