wiziple / gatsby-plugin-intl

Gatsby plugin that turns your website into an internationalization-framework out of the box.
http://gatsby-starter-default-intl.netlify.com
325 stars 178 forks source link

All locale data included in bundle #232

Open MaximeCheramy opened 1 year ago

MaximeCheramy commented 1 year ago

Since intl-relativetimeformat 6.0, the locales are no longer located in the dist subfolder (https://github.com/formatjs/formatjs/blob/main/packages/intl-relativetimeformat/CHANGELOG.md#600-2020-07-03). As a consequence, this line has no effect:

https://github.com/wiziple/gatsby-plugin-intl/blob/master/src/gatsby-node.js#L29

new webpack.ContextReplacementPlugin(
        /@formatjs[/\\]intl-relativetimeformat[/\\]dist[/\\]locale-data$/,
        regex
      )

The fix is probably to just remove the dist[/\\] part but I haven't tried.

LukasAV commented 3 months ago

I was inspecting my bundle size and noticed the same thing. @wiziple any update here why the PR could not be merged?