Skip to content

Commit

Permalink
Add workaround for minification quirk in Metro Bundler (#737)
Browse files Browse the repository at this point in the history
  • Loading branch information
kitten authored Apr 22, 2020
1 parent 25f6fb0 commit 67db164
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/afraid-flies-matter.md
Original file line number Diff line number Diff line change
@@ -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.
3 changes: 3 additions & 0 deletions scripts/rollup/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 67db164

Please sign in to comment.