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

release-drink backport: Fix Webpack production mode compatibility #6981

Merged
merged 2 commits into from
Jul 17, 2018

Conversation

jfirebaugh
Copy link
Contributor

Backports #6956 to release-drink

A proposal for fixing #4359. Sets ignoreGlobal: true option for rollup-plugin-commonjs plugin, turning off its handling of the global keyword in CommonJS modules, and upgrades the plugin to the latest version (because the option didn't work properly in the previous one). In particular, it stops transforming top-level this reference into a variable that contains the typeof global check (which consequently triggered Webpack issues).

One consequence of the fix is that GL JS will throw a runtime error when it encounters a reference to the global keyword. However, there are no such instances in the bundle currently — the only real reference I found (in the browserified node assert module) gets treeshaken away because it's in unused methods. So in theory this fix won't bring much trouble unless we plan on using Node-targeted modules with the global keyword in future.

Thanks a lot to @Aendrew who provided a minimal repro that helped me find this fix.

@jfirebaugh jfirebaugh requested review from anandthakker and mourner and removed request for anandthakker July 17, 2018 20:26
@jfirebaugh jfirebaugh merged commit 3f4acc8 into release-drink Jul 17, 2018
@jfirebaugh jfirebaugh deleted the backport-6956 branch July 17, 2018 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants