Skip to content

Commit e223099

Browse files
committed
feat: add fix for reanimated
1 parent 677d1f9 commit e223099

File tree

2 files changed

+77
-48
lines changed

2 files changed

+77
-48
lines changed

patches/@mendix+pluggable-widgets-tools+10.21.1.patch

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,47 @@ index 2d0b5bfac7f1a1482bc1a222cba3e52b0339cc79..a3f0e368d76d294a5f7cd85886fe5ce0
7878

7979
function getModuleName(modulePath) {
8080
diff --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
84-
@@ -62,7 +62,7 @@ const nativeExternal = [
84+
@@ -62,7 +62,8 @@ const nativeExternal = [
8585
/^react($|\/)/,
8686
/^react-native-gesture-handler($|\/)/,
8787
/^react-native-reanimated($|\/)/,
8888
- /^react-native-fast-image($|\/)/,
8989
+ /^@d11\/react-native-fast-image($|\/)/,
90+
+ /^@gorhom\/bottom-sheet($|\/)/,
9091
/^react-native-svg($|\/)/,
9192
/^react-native-vector-icons($|\/)/,
9293
/^@?react-navigation($|\/)/,
94+
@@ -177,6 +178,18 @@ export default async args => {
95+
return result;
96+
97+
function getCommonPlugins(config) {
98+
+ const hasReanimated = (() => {
99+
+ try {
100+
+ const packageJson = require(join(sourcePath, "package.json"));
101+
+ return !!(
102+
+ (packageJson.dependencies && packageJson.dependencies["react-native-reanimated"]) ||
103+
+ (packageJson.peerDependencies && packageJson.peerDependencies["react-native-reanimated"])
104+
+ );
105+
+ } catch {
106+
+ return false;
107+
+ }
108+
+ })();
109+
+
110+
return [
111+
nodeResolve({ preferBuiltins: false, mainFields: ["module", "browser", "main"] }),
112+
isTypescript
113+
@@ -230,7 +243,7 @@ export default async args => {
114+
})
115+
: null,
116+
image(),
117+
- production ? terser({ mangle: false }) : null,
118+
+ production && !hasReanimated ? terser({ mangle: false }) : null,
119+
// We need to create .mpk and copy results to test project after bundling is finished.
120+
// In case of a regular build is it is on `writeBundle` of the last config we define
121+
// (since rollup processes configs sequentially). But in watch mode rollup re-bundles only
93122
diff --git a/test-config/jest.native.config.js b/test-config/jest.native.config.js
94123
index 72e3c51473b7566ca9d8b224b35334099ce615db..7e0949aa5d50d288d848117a804fd691422aefde 100644
95124
--- a/test-config/jest.native.config.js

0 commit comments

Comments
 (0)