expo / vector-icons

https://icons.expo.fyi
MIT License
647 stars 114 forks source link

Remove unused icon sets #248

Closed Thanaen closed 1 year ago

Thanaen commented 1 year ago

I'm using @expo/vector-icons only for the "createIconSetFromIcoMoon" function, so I'd like to remove the default fonts from my application builds.

With react-native-vector-icons, this can be done by specifying no font in the build.gradle file, and adding this in the react-native.config.js file:

module.exports = {
  dependencies: {
    'react-native-vector-icons': {
      platforms: {
        ios: null,
      },
    },
  },
};

How do you achieve the same behavior with @expo/vector-icons?

Thanaen commented 1 year ago

I learned on the Expo forums (thanks @wodin) that importing the createIconSetFromIconMoon method like this import createIconSetFromIcoMoon from '@expo/vector-icons/createIconSetFromIcoMoon'; avoids importing fonts.

I hope this helps others!