mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-25 07:59:48 +01:00
31 lines
699 B
JavaScript
31 lines
699 B
JavaScript
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 = {
|
|
presets: ["module:@react-native/babel-preset"],
|
|
plugins: [
|
|
"@babel/plugin-transform-named-capturing-groups-regex",
|
|
"@babel/plugin-transform-export-namespace-from"
|
|
]
|
|
};
|
|
|
|
if (env === "production") {
|
|
env.plugins.push("transform-remove-console");
|
|
}
|
|
|
|
if (env === "test") {
|
|
env.overrides.push({
|
|
test: "../node_modules/jest-runner"
|
|
});
|
|
}
|
|
|
|
env.plugins.push("react-native-worklets/plugin");
|
|
|
|
api.cache(true);
|
|
return env;
|
|
};
|