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

When keeping locales, match full locale names #25

Merged
merged 2 commits into from
Nov 17, 2019

Conversation

iamakulov
Copy link
Owner

Before this commit, ContextReplacementPlugin was configured to only match locale endings. Because of that, if someone used MomentLocalesPlugin with e.g. localesToKeep: ['ca'], the plugin kept bundled files ca.js, en-ca.js and fr-ca.js.

This PR ensures we match full locale names so no extra locales get bundled.

Closes #13.

Right now, the Regex we use only matches locale endings. Because of this, if a customer wants to uses localesToKeep: ['ca'], we also keep locales like `en-ca` and `fr-ca`. This commit fixes that.
@iamakulov iamakulov merged commit 29ebb6a into master Nov 17, 2019
@iamakulov iamakulov deleted the match-locales-better branch November 17, 2019 15:10
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.

Force localesToKeep to match exactly
1 participant