question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Removing unused font families from final bundle?

See original GitHub issue

Currently looking into reducing the size of an app slightly. I’m only using the Ionicons font family, so removing all the rest would save around half a mb. Followed apples docs (here) and inspected the unzipped ipa. As I thought, all font families from react-native-vector-icons are included (from running react-native link).

image

Am I right in thinking that simply deleting the file and selecting Move to trash will handle the whole thing?

image

From what I see in version control references have been removed from project.pbxproj.

Only downside I can see to this is that if someone else starts up the project and runs rnpm link after including a new component or something, they’ll get the fonts included again.

Thanks

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
shirakabacommented, Apr 20, 2021

I just checked the podspec commit history and it’s actually always had that line. So I don’t know why there was a clash between the two build steps when I was using it yesterday and not when I was using it 1-2 years ago. 🤷‍♂️

1reaction
shirakabacommented, Apr 20, 2021

I guess all the fonts are being added on the Copy Pods Resources step due to this line in the podspec, which specifies all font files via a glob:

https://github.com/oblador/react-native-vector-icons/blob/204e49d8597bd792ea2011c4b93ced22eb9133ca/RNVectorIcons.podspec#L15

Incidentally, the instructions on the README still instruct the user to manually add the individual font files via the Copy Bundle Resources phase, but now this actually causes a build failure due to the Copy Pods Resources step repeating the very same action.

@ospfranco in an earlier version of this library, I believe the podspec didn’t have that line, so you could roll back to using that version which would allow you to specify the exact font files you’re using and no more.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Install or remove fonts on your Mac - Apple Support
Select the font. Choose File > Remove. Font Book moves the font to the Trash, and the font no longer appears in the...
Read more >
Excessive fonts installed by default - Ubuntu Discourse
Hi, I'm a long-time Ubuntu user and have been trying to find out how/where to suggest trimming the amount of fonts that are...
Read more >
Unused fonts/subsets still in the CSS which cause slow speed ...
Hi there. I have problem with my website speed. Google decrease my ranking and Speed score in PageSpeed Insight is low.
Read more >
Remove unused font families from code - Webflow Wishlist
There is no way to remove these font families or track if they are showing in your code. It makes a small difference...
Read more >
PurgeCSS: Remove unused CSS code - LogRocket Blog
0, unused font faces and keyframes code were removed by default. However, when these features were used incorrectly, the code would break.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found