Removing unused font families from final bundle?
See original GitHub issueCurrently 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
).
Am I right in thinking that simply deleting the file and selecting Move to trash will handle the whole thing?
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:
- Created 7 years ago
- Comments:9 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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. 🤷♂️
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.