Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workaround for minification quirk in Metro Bundler #737

Merged
merged 2 commits into from
Apr 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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