oblador / react-native-vector-icons

Customizable Icons for React Native with support for image source and full styling.
https://oblador.github.io/react-native-vector-icons/
MIT License
17.44k stars 2.12k forks source link

Trim fonts from RNVI #1061

Open rollsroyc3 opened 5 years ago

rollsroyc3 commented 5 years ago

I currently use RNVI for the following fonts:

Im wondering if its possible (or even worth it) to remove the unused fonts to decrease bloat, etc.. I think there are 8 that I dont use, so dont see a reason to keeping them unless its a pain to remove..

hampustagerud commented 5 years ago

Sure! There's no magic to it really, just don't bundle them with the app. For Android use the gradle approach and for iOS just remove them from the build phase (in Xcode) where the fonts are copied 🙂

pk936 commented 4 years ago

@hampustagerud I tried to reduce my bundle size by removing unused icons using the following. But the size is still same.

project.ext.vectoricons = [
    iconFontNames: [ 'MaterialIcons.ttf', 'EvilIcons.ttf' ] // Name of the font files you want to copy
]

apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
TrebuhD commented 3 years ago

On iOS, I can remove them from the build phase, but they reappear automatically after a pod install. It'd be nice to not have to do that, although I'm not sure how to get there.