Skip to content

Removing en-US locale from bundle #1853

Discussion options

You must be logged in to vote

To be honest, I'm not quite sure how webpack.ContextReplacementPlugin works in this context, but to replace the default locale you can use NormalModuleReplacementPlugin:

new webpack.NormalModuleReplacementPlugin(
  /locale\/en-US/,
  'date-fns/locale/ru'
)

It will replace en-US locale, so you can skip passing ru to functions. I just tested it on my app and works as expected:

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@danilstoyanov
Comment options

Comment options

You must be logged in to vote
1 reply
@danilstoyanov
Comment options

Answer selected by danilstoyanov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants