fix(useLocale): update locale import to enable tree shaking #2735
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
π Linked issue
Resolves #2734
β Type of change
π Description
The proposed change modifies the import to directly reference the required locale.
Final bundle from
![before](https://private-user-images.githubusercontent.com/42286100/389039632-eee75b9a-aacb-43ad-9140-8a2afd2d4ae9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MDAzMDgsIm5iZiI6MTczOTYwMDAwOCwicGF0aCI6Ii80MjI4NjEwMC8zODkwMzk2MzItZWVlNzViOWEtYWFjYi00M2FkLTkxNDAtOGEyYWZkMmQ0YWU5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDA2MTMyOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTIxYmIzMzg2YmM1OWRiZjM5YjBmOTBiOWNjYTkwZTQxYjlmNWMyYmMyNjEzNGY0OTNjNGMwYmM0ZmI2YzBlZjkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.RoJghI8869Kqd7W6veeAtyCMlV8RinFWjhdyeqku-H0)
import { en } from '../locale'
(before):Final bundle from
![after](https://private-user-images.githubusercontent.com/42286100/389039897-b83e5eeb-a1af-4713-81cc-e7f5d74a5ad3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MDAzMDgsIm5iZiI6MTczOTYwMDAwOCwicGF0aCI6Ii80MjI4NjEwMC8zODkwMzk4OTctYjgzZTVlZWItYTFhZi00NzEzLTgxY2MtZTdmNWQ3NGE1YWQzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDA2MTMyOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJhZTc4YTU5M2U2ZmFmMTExZTgxNmI5OWYyMDY4NDRkZjljMThiNTZhNTY4MjhlM2E3NjkyMzg4MmJkOGJjOTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.xjnlx0-9op20T9P3sXpAGdUF9cDdz_pDdZhk-6VoUjQ)
import en from '../locale/en'
(after):π Checklist