Removing en-US locale from bundle #1853
-
Hello guys! But I wonder, is it possible to remove en-US locale from bundle if I need to use only Ru locale? I tried to use Or en-US locale is default and it's not possible to remove it somehow? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hey! Yes, it's possible to replace the default locale. Could you please show code snippet with the usage of |
Beta Was this translation helpful? Give feedback.
-
To be honest, I'm not quite sure how new webpack.NormalModuleReplacementPlugin(
/locale\/en-US/,
'date-fns/locale/ru'
) It will replace |
Beta Was this translation helpful? Give feedback.
To be honest, I'm not quite sure how
webpack.ContextReplacementPlugin
works in this context, but to replace the default locale you can useNormalModuleReplacementPlugin
:It will replace
en-US
locale, so you can skip passingru
to functions. I just tested it on my app and works as expected: