Reduce size in Ant Design Bundle Size

Narendra Sisodiya
1 min readAug 24, 2019

Wrong-Way

import { Button, DatePicker, message, Alert } from 'antd';

Right Way


import Button from 'antd/es/button';
import Alert from 'antd/es/alert';
import DatePicker from 'antd/es/date-picker';
import message from 'antd/es/message';

Adding individual components will save size.

This is applicable to Lodash, Material UI and similar libraries which support individual export of modules/submodules.

--

--