diff --git a/patches/@mendix+pluggable-widgets-tools+10.15.0.patch b/patches/@mendix+pluggable-widgets-tools+10.15.0+001+initial.patch similarity index 100% rename from patches/@mendix+pluggable-widgets-tools+10.15.0.patch rename to patches/@mendix+pluggable-widgets-tools+10.15.0+001+initial.patch diff --git a/patches/@mendix+pluggable-widgets-tools+10.15.0+002+conditional-terser-for-reanimated.patch b/patches/@mendix+pluggable-widgets-tools+10.15.0+002+conditional-terser-for-reanimated.patch new file mode 100644 index 000000000..f85c4465f --- /dev/null +++ b/patches/@mendix+pluggable-widgets-tools+10.15.0+002+conditional-terser-for-reanimated.patch @@ -0,0 +1,45 @@ +diff --git a/node_modules/@mendix/pluggable-widgets-tools/configs/rollup.config.native.js b/node_modules/@mendix/pluggable-widgets-tools/configs/rollup.config.native.js +index bb8cc3a..34e0877 100644 +--- a/node_modules/@mendix/pluggable-widgets-tools/configs/rollup.config.native.js ++++ b/node_modules/@mendix/pluggable-widgets-tools/configs/rollup.config.native.js +@@ -169,6 +169,17 @@ export default async args => { + return result; + + function getCommonPlugins(config) { ++ const hasReanimated = (() => { ++ try { ++ const packageJson = require(join(sourcePath, "package.json")); ++ return !!( ++ (packageJson.dependencies && packageJson.dependencies["react-native-reanimated"]) || ++ (packageJson.peerDependencies && packageJson.peerDependencies["react-native-reanimated"]) ++ ); ++ } catch { ++ return false; ++ } ++ })(); + return [ + nodeResolve({ preferBuiltins: false, mainFields: ["module", "browser", "main"] }), + isTypescript +@@ -223,7 +234,21 @@ export default async args => { + }) + : null, + image(), +- production ? terser({ mangle: false }) : null, ++ production ? terser(hasReanimated ++ ? { ++ mangle: false, ++ compress: { ++ defaults: false, ++ inline: false, ++ reduce_funcs: false, ++ side_effects: false, ++ }, ++ keep_fnames: true, ++ keep_classnames: true, ++ module: false, ++ format: { comments: false } ++ } ++ : { mangle: false }) : null, + // We need to create .mpk and copy results to test project after bundling is finished. + // In case of a regular build is it is on `writeBundle` of the last config we define + // (since rollup processes configs sequentially). But in watch mode rollup re-bundles only