When using date-fns, all locales are imported
thomastvedt opened this issue · comments
picker/src/generate/dateFns.ts
Line 27 in e3f8437
This will import all locales from date-fns, right? Even if only one or two locales are used, this will import all of them?
@thomastvedt sir this will definitely import all the locales even if we are using just one or two. The drawback of this is that since all the locales are being imported unnecessarily, our bundle size will increase which can harm site's performance. Instead, we can do like this :-
import { enUS, es, fr } from 'date-fns/locale';
It would be great if rc-picker could support only loading locales that are used 👌🌸