components icon indicating copy to clipboard operation
components copied to clipboard

Fortawesome: treeshaking behavior not working

Open ocBruno opened this issue 5 years ago • 6 comments

🐛 Bug Report

After looking at the size of the build and the config I noticed the whole free-solid-svg-icons library was being imported.

To reproduce

yarn clone github.com/hospitalrun/components view index.tsx file

This bug is related to following issue as it is taking up space in the hospitalrun build

https://github.com/HospitalRun/hospitalrun-frontend/issues/1808

Expected behavior

Only import necessary icons

  • node version: 12.16.0
  • os: Windows

ocBruno avatar Feb 15 '20 04:02 ocBruno

Some reference: https://fontawesome.com/how-to-use/with-the-api/other/tree-shaking

matteovivona avatar Feb 15 '20 19:02 matteovivona

Some reference: https://fontawesome.com/how-to-use/with-the-api/other/tree-shaking

Thanks for the reference, this is what I was using to debug but I attempted various methods with no success and stopped at the custom build configs. Not sure if anyone with rollup experience wants to tackle this..

ocBruno avatar Feb 15 '20 22:02 ocBruno

@lloui-donut which commit do you refer to?

matteovivona avatar Aug 06 '20 14:08 matteovivona

seems to be a commit that was never merged into the main repo...

matteovivona avatar Aug 07 '20 07:08 matteovivona

A group of students from a university course was hoping to take this on for an open-source assignment, could we take this on?

ChrisDryden avatar Dec 02 '20 20:12 ChrisDryden

@ocBruno I'd like to work on this issue

ghost avatar Jan 15 '22 00:01 ghost