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

fix: restore UMD module breaking #95

Merged
merged 1 commit into from
Dec 4, 2019
Merged

fix: restore UMD module breaking #95

merged 1 commit into from
Dec 4, 2019

Conversation

NoriSte
Copy link
Contributor

@NoriSte NoriSte commented Dec 4, 2019

TL;DR: The extreme minification removes even the ".Perfume=" part that is essential to get the UMD module working if loaded from a CDN. Without this fix, Perfume is undefined in a page that loads the UMD version through a CDN.

My Perfume.js for Gatsby plugin cannot update Perfume.js to the latest version. That's because of a failing test, the one that checks that Perfume.js could be consumed through Unpkg (instead of installing/importing in the local project). Here the option and here the option management.
The test fails because the previous version(line 1, column 155) has a Perfume= code that it is disappeared in the new version (that makes the global scope "dirty" with a t variable).

@Zizzamia suggested me how to solve it, I have tested it locally and I can confirm that everything works with this change.

This way I could update my Gatsby plugin to leverage the latest Perfume.js version 😊

The extreme minification removes even the ".Perfume=" part that is essential to get the UMD module working if loaded from a CDN. Without this fix, `Perfume` is `undefined` in a page that loads the UMD version through a CDN.
@Zizzamia Zizzamia self-requested a review December 4, 2019 06:42
@Zizzamia Zizzamia merged commit c29b644 into Zizzamia:master Dec 4, 2019
@Zizzamia
Copy link
Owner

Zizzamia commented Dec 4, 2019

Amazing, thank you @NoriSte for such a quick response 🙌

@NoriSte NoriSte deleted the patch-1 branch December 4, 2019 06:47
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