react-component / picker

📅 All Date Pickers you need.

Home Page:https://picker.react-component.now.sh/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When using date-fns, all locales are imported

thomastvedt opened this issue · comments

import * as Locale from 'date-fns/locale';

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 👌🌸