diff --git a/.changeset/afraid-flies-matter.md b/.changeset/afraid-flies-matter.md new file mode 100644 index 0000000000..5fefc7e24e --- /dev/null +++ b/.changeset/afraid-flies-matter.md @@ -0,0 +1,5 @@ +--- +'@urql/core': patch +--- + +Hoist variables in unminified build output for Metro Bundler builds which otherwise fails for `process.env.NODE_ENV` if-clauses. 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,