ant-design-icons icon indicating copy to clipboard operation
ant-design-icons copied to clipboard

[Help] How to use it with `babel-plugin-import`.

Open xyy94813 opened this issue 5 years ago • 2 comments

Now, I only use a few icons in @ant-design/icons.

I will use more in the future, but I definitely can't use all the icons.

When i import @ant-design/icons like this:

import { AntDesignOutline, DashboardOutline, TwitterOutline } from '@ant-design/icons';
import AntdIcon from '@ant-design/icons-react';

AntdIcon.add(AntDesignOutline, DashboardOutline);

Webpack bundle all icons, including what I didn't use.

I am not sure if I can use it with babel-plugin-import.

It is awesome, if we can dynamic import icons just like antd

xyy94813 avatar Oct 24 '19 02:10 xyy94813

Any updates on this?

kckusal avatar Apr 12 '21 11:04 kckusal

I don't know if it works well

[
  "import",
    {
      "libraryName": "@ant-design/icons",
      "customName": (name, file) => {
          // do something in this
          // return `libs/${name}`
       }
    }
]

xyy94813 avatar Apr 12 '21 13:04 xyy94813