Closed artemtam closed 5 years ago
Hey @wiziple I actually think this is quite important. You have 1 MB of unused translations in the example app build, a lot of people use it in production also.
Updated! Haha thanks for poking me! Yeah, I had no time to do it, and I'm still using old plugin version on my production 😂
By default Webpack imports all
@formatjs
localization files, because during the build it doesn't know what exactly the application need. To fix this behaviorContextReplacementPlugin
is used, though it doesn't work correctly.Currently,
gatsby-plugin-intl
imports all the localizations regardless of what languages are set in the config:To fix this, in
gatsby-node.js
replacewith
After the changes the final build looks way better: