@@ -78,7 +78,7 @@ index 2d0b5bfac7f1a1482bc1a222cba3e52b0339cc79..a3f0e368d76d294a5f7cd85886fe5ce0
7878
7979 function getModuleName(modulePath) {
8080diff --git a/configs/rollup.config.native.mjs b/configs/rollup.config.native.mjs
81- index 682cf9fc4259a1f431e7cc3b17a319fdb072929e..5be03c770f8247637223f78738c3cdecae4d3d92 100644
81+ index 682cf9fc4259a1f431e7cc3b17a319fdb072929e..b02cc48a73e4e8d7879993669daa036159ed6b6c 100644
8282--- a/configs/rollup.config.native.mjs
8383+++ b/configs/rollup.config.native.mjs
8484@@ -62,7 +62,7 @@ const nativeExternal = [
@@ -90,6 +90,34 @@ index 682cf9fc4259a1f431e7cc3b17a319fdb072929e..5be03c770f8247637223f78738c3cdec
9090 /^react-native-svg($|\/)/,
9191 /^react-native-vector-icons($|\/)/,
9292 /^@?react-navigation($|\/)/,
93+ @@ -177,6 +177,18 @@ export default async args => {
94+ return result;
95+
96+ function getCommonPlugins(config) {
97+ + const hasReanimated = (() => {
98+ + try {
99+ + const packageJson = require(join(sourcePath, "package.json"));
100+ + return !!(
101+ + (packageJson.dependencies && packageJson.dependencies["react-native-reanimated"]) ||
102+ + (packageJson.peerDependencies && packageJson.peerDependencies["react-native-reanimated"])
103+ + );
104+ + } catch {
105+ + return false;
106+ + }
107+ + })();
108+ +
109+ return [
110+ nodeResolve({ preferBuiltins: false, mainFields: ["module", "browser", "main"] }),
111+ isTypescript
112+ @@ -230,7 +242,7 @@ export default async args => {
113+ })
114+ : null,
115+ image(),
116+ - production ? terser({ mangle: false }) : null,
117+ + production && !hasReanimated ? terser({ mangle: false }) : null,
118+ // We need to create .mpk and copy results to test project after bundling is finished.
119+ // In case of a regular build is it is on `writeBundle` of the last config we define
120+ // (since rollup processes configs sequentially). But in watch mode rollup re-bundles only
93121diff --git a/test-config/jest.native.config.js b/test-config/jest.native.config.js
94122index 72e3c51473b7566ca9d8b224b35334099ce615db..7e0949aa5d50d288d848117a804fd691422aefde 100644
95123--- a/test-config/jest.native.config.js
0 commit comments