Fontawesome 5 重复标识符

Fontawesome 5 duplicate identifier

如何在我的 angular 项目中同时加载 faCircle 的常规版本和固定版本(例如)?

如果我在 app.component.ts 中声明如下:

import faCircle from '@fortawesome/fontawesome-pro-solid/faCircle';
import faCircle from '@fortawesome/fontawesome-pro-regular/faCircle';

fontawesome.library.add(faCircle);
fontawesome.library.add(faCircle);

我在构建过程中会遇到以下错误:

ERROR in src/app/app.component.ts(22,9): error TS2300: Duplicate identifier 'faCircle'. src/app/app.component.ts(24,51): error TS2300: Duplicate identifier 'faCircle'.

愚蠢的打字稿问题...无论如何,这是我几分钟后找到的解决方案

import {faCircle as faCircleSolid} from '@fortawesome/fontawesome-pro-solid';
import {faCircle as faCircleRegular} from '@fortawesome/fontawesome-pro-regular';

fontawesome.library.add(faCircleSolid);
fontawesome.library.add(faCircleRegular);