Something went wrong. Try again.
Bluesky app fork with some witchin' additions 💫 forked from jollywhoppers.com/witchsky.app
Something went wrong. Try again.
witchsky.app babel.config.js
1.6 kB · 51 lines
JavaScript
at main
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152/** * @param {import("@babel/core").ConfigAPI} api * @returns {import("@babel/core").InputOptions} */module.exports = function (api) { return { presets: [ [ 'babel-preset-expo', { lazyImports: true, native: { // Disable ESM -> CJS compilation because Metro takes care of it. // However, we need it in Jest tests since those run without Metro. disableImportExportTransform: !api.env('test'), }, }, ], ], plugins: [ '@lingui/babel-plugin-lingui-macro', ['babel-plugin-react-compiler', {target: '19'}], 'module:react-native-dotenv', // used by web build! can remove when we drop webpack [ 'module-resolver', { alias: { // This needs to be mirrored in tsconfig.json '#': './src', crypto: './src/platform/crypto.ts', }, }, ],
// cannot use `env` field because it will put them after // the `react-native-worklets/plugin` plugin ...(api.env('test') ? [ '@babel/plugin-transform-class-static-block', // Compile `import()` to require so jest (which runs without // `--experimental-vm-modules`) can execute lazily-loaded modules // like `@ipld/dag-cbor` via its moduleNameMapper. '@babel/plugin-transform-dynamic-import', ] : []), ...(api.env('production') ? ['transform-remove-console'] : []),
'react-native-worklets/plugin', // NOTE: this plugin MUST be last ], }}