Replies: 1 comment
-
There is official documentation to exclude locales with Webpack's ContextReplacementPlugin. I don't think the approach will allow you to strip out There might be other (better?) ways, but I did successfully manage to use the string-replace-loader Webpack loader to change the default locale to {
test: /_lib\/defaultLocale\/index\.js$/,
loader: 'string-replace-loader',
options: {
search: '/locale/en-US/',
replace: '/locale/de/',
},
} You won't need to explicitly set import { format } from 'date-fns';
format(new Date(), 'PPPP') // Sonntag, 30. Oktober 2022 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First off - thanks for a great lib!
I need some clarification here.
Let's say I know what locale I'll be using throughout the app at the build time, so I do this:
Yet the
en-US
end up in the bundle anyway.Is there a way to tell date-fns/bundler to truly set one default locale once and for all?
Beta Was this translation helpful? Give feedback.
All reactions