From c5bbde61e977358466d971725c10f5e35f35cc74 Mon Sep 17 00:00:00 2001 From: Phil Pluckthun Date: Wed, 22 Apr 2020 14:16:16 +0100 Subject: [PATCH] Hoist variables in unminified build output for Metro --- scripts/rollup/plugins.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/rollup/plugins.js b/scripts/rollup/plugins.js index c12ba34d6f..06a901d44c 100644 --- a/scripts/rollup/plugins.js +++ b/scripts/rollup/plugins.js @@ -112,6 +112,9 @@ const terserPretty = terser({ keep_fnames: true, ie8: false, compress: { + // We need to hoist vars for process.env.NODE_ENV if-clauses for Metro: + hoist_vars: true, + hoist_funs: true, pure_getters: true, toplevel: true, booleans_as_integers: false,