perf: Antd icons tree shaking (#29787)
Co-authored-by: Maxime Beauchemin <maximebeauchemin@gmail.com>
This commit is contained in:
parent
d143b24232
commit
5936e8dbca
|
|
@ -17,10 +17,95 @@
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import * as AntdIcons from '@ant-design/icons/lib/icons';
|
// NOTE: Targeted import (as opposed to `import *`) is important here for proper tree-shaking
|
||||||
|
import {
|
||||||
|
AlignCenterOutlined,
|
||||||
|
AlignLeftOutlined,
|
||||||
|
AlignRightOutlined,
|
||||||
|
ApartmentOutlined,
|
||||||
|
BarChartOutlined,
|
||||||
|
BookOutlined,
|
||||||
|
CalendarOutlined,
|
||||||
|
CheckOutlined,
|
||||||
|
CheckSquareOutlined,
|
||||||
|
CloseOutlined,
|
||||||
|
ConsoleSqlOutlined,
|
||||||
|
CopyOutlined,
|
||||||
|
DatabaseOutlined,
|
||||||
|
DeleteFilled,
|
||||||
|
DownOutlined,
|
||||||
|
EditOutlined,
|
||||||
|
ExclamationCircleOutlined,
|
||||||
|
EyeOutlined,
|
||||||
|
EyeInvisibleOutlined,
|
||||||
|
FallOutlined,
|
||||||
|
FileImageOutlined,
|
||||||
|
FileOutlined,
|
||||||
|
FireOutlined,
|
||||||
|
FullscreenExitOutlined,
|
||||||
|
FullscreenOutlined,
|
||||||
|
FundProjectionScreenOutlined,
|
||||||
|
InfoCircleOutlined,
|
||||||
|
InsertRowBelowOutlined,
|
||||||
|
MonitorOutlined,
|
||||||
|
PlusCircleOutlined,
|
||||||
|
PlusOutlined,
|
||||||
|
ReloadOutlined,
|
||||||
|
RightOutlined,
|
||||||
|
SaveOutlined,
|
||||||
|
SearchOutlined,
|
||||||
|
SettingOutlined,
|
||||||
|
StopOutlined,
|
||||||
|
TagsOutlined,
|
||||||
|
UpOutlined,
|
||||||
|
UserOutlined,
|
||||||
|
} from '@ant-design/icons';
|
||||||
import { StyledIcon } from './Icon';
|
import { StyledIcon } from './Icon';
|
||||||
import IconType from './IconType';
|
import IconType from './IconType';
|
||||||
|
|
||||||
|
const AntdIcons = {
|
||||||
|
AlignCenterOutlined,
|
||||||
|
AlignLeftOutlined,
|
||||||
|
AlignRightOutlined,
|
||||||
|
ApartmentOutlined,
|
||||||
|
BarChartOutlined,
|
||||||
|
BookOutlined,
|
||||||
|
CalendarOutlined,
|
||||||
|
CheckOutlined,
|
||||||
|
CheckSquareOutlined,
|
||||||
|
CloseOutlined,
|
||||||
|
ConsoleSqlOutlined,
|
||||||
|
CopyOutlined,
|
||||||
|
DatabaseOutlined,
|
||||||
|
DeleteFilled,
|
||||||
|
DownOutlined,
|
||||||
|
EditOutlined,
|
||||||
|
ExclamationCircleOutlined,
|
||||||
|
EyeOutlined,
|
||||||
|
EyeInvisibleOutlined,
|
||||||
|
FallOutlined,
|
||||||
|
FileImageOutlined,
|
||||||
|
FileOutlined,
|
||||||
|
FireOutlined,
|
||||||
|
FullscreenExitOutlined,
|
||||||
|
FullscreenOutlined,
|
||||||
|
FundProjectionScreenOutlined,
|
||||||
|
InfoCircleOutlined,
|
||||||
|
InsertRowBelowOutlined,
|
||||||
|
MonitorOutlined,
|
||||||
|
PlusCircleOutlined,
|
||||||
|
PlusOutlined,
|
||||||
|
ReloadOutlined,
|
||||||
|
RightOutlined,
|
||||||
|
SaveOutlined,
|
||||||
|
SearchOutlined,
|
||||||
|
SettingOutlined,
|
||||||
|
StopOutlined,
|
||||||
|
TagsOutlined,
|
||||||
|
UpOutlined,
|
||||||
|
UserOutlined,
|
||||||
|
};
|
||||||
|
|
||||||
const AntdEnhancedIcons = Object.keys(AntdIcons)
|
const AntdEnhancedIcons = Object.keys(AntdIcons)
|
||||||
.filter(k => !k.includes('TwoTone'))
|
.filter(k => !k.includes('TwoTone'))
|
||||||
.map(k => ({
|
.map(k => ({
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue