Skip to content

How to include all locales? #2719

Discussion options

You must be logged in to vote

You need to name the wildcard export if you are to reference it in your code. If this is client-side, keep in mind that this might significantly affect your bundle size.

import * as locales from 'date-fns/locale'

console.log(locales.enUS.code) // en-US

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@web-programmer-here
Comment options

@web-programmer-here
Comment options

@fturmel
Comment options

Answer selected by web-programmer-here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants