-
-
Notifications
You must be signed in to change notification settings - Fork 516
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
Luxonless binary should not contain any luxon imports. #410
Conversation
Uses NormalModuleReplacement to swap luxon with a fake.
@jakubroztocil / @davidgoli: friendly ping 🏓 |
Thanks! |
Thank you for merging this fix! |
@samouri I hope to find a time for it over the weekend (unless @davidgoli beats me to it). Out of curiosity—what is your |
Awesome!
I work for AMP, and we use |
@samouri thanks for the background. |
summary
Fixes #344, and maybe #402.
Currently the build produced without timezone support still references
luxon
and expects the code to throw aTypeError
if incorrectly used (done via webpack externals). You can verify this by searching for "luxon" within the contents ofdist/es5/rrule.min.js
.This causes issue when mixed with compilers that don't have the same notion of an external, e.g. Closure Compiler (google/closure-compiler#954). Specifically, the AMP Project is running into when trying to build rrule into our
amp-date-picker
component (ampproject/amphtml#28887).This PR uses NormalModuleReplacementPlugin to replace luxon with a fake implementation that immediately throws.