Generated files contains a lot of unused CSS

Hello :smiley:

After building a simple Plasmic / Gatsby project I realized that the major part of the generated index.html was just CSS, with a lot of it being unused (according to IntelliJ).

I created a dumb script to remove all unused CSS and it managed to reduce the page size by more than 50% while keeping the same appearance.

[Optimizer] CSS Blocks before: 221 after: 48
[Optimizer] Size before: 48944 after: 20948

So I think it would be great if all this unused CSS was removed. Maybe it is just some configuration to do on Gatsby side, I didn’t search further.

1 Like

Thanks for reporting this and for sharing your research! We’ll dig into this.

1 Like