Files
iNaturalistReactNative/babel.config.js
Johannes Klein 2efb99fb74 Switch to @native-html/render to support markdown again (#3553)
* Update package.json

Without the babel plugin the app does not start because of an error with the new package.

* Update babel.config.js

* Update package-lock.json

* Switch to new package for Wikipedia text

* Update Podfile.lock

* Use new package in UserText

* Link underline was blue, now green again

* Make headings in user text the same as in the app

* Fix typo?

Not hundred percent sure about this, but MDN docs show no t tag and the original list in inaturalist has tfoot in this place here.

* Remove tag that is not supported on web

* Refactor making of html into helper function

* Update index.ts

* Create a snapshot test for build html function
2026-04-21 22:03:34 +02:00

39 lines
1.3 KiB
JavaScript

module.exports = {
presets: ["module:@react-native/babel-preset"],
plugins: [
"babel-plugin-react-compiler", // must run first!
"@babel/plugin-transform-export-namespace-from",
"react-native-worklets-core/plugin",
"transform-inline-environment-variables",
"nativewind/babel",
["module-resolver", {
alias: {
// constants is a reserved word, so jest won't run if we name the alias constants
appConstants: "./src/appConstants",
api: "./src/api",
components: "./src/components",
dictionaries: "./src/dictionaries",
i18n: "./src/i18n",
images: "./src/images",
// for some reason, this doesn't seem to work for models, so I'm leaving that directory out
navigation: "./src/navigation",
providers: "./src/providers",
realmModels: "./src/realmModels",
sharedHelpers: "./src/sharedHelpers",
sharedHooks: "./src/sharedHooks",
stores: "./src/stores",
styles: "./src/styles",
tests: "./tests",
uploaders: "./src/uploaders",
},
}],
// Reanimated 4: use worklets plugin (must be listed last). See migration 3.x -> 4.x.
"react-native-worklets/plugin",
],
env: {
production: {
plugins: ["react-native-paper/babel", "transform-remove-console"],
},
},
};