https://docs.expo.io/bare/installing-unimodules/
If you need to exclude some of the unimodules that you are not using but they got installed by your other dependencies (like
expo
), then you can pass inexclude
param for this. For example, if you want to excludeexpo-face-detector
, you may want to use this:use_unimodules!(exclude: ['expo-face-detector'])
If you need to exclude some of the unimodules that you are not using but they got installed by your other dependencies (likeexpo
), then you can pass inexclude
param for this. For example, if you want to excludeexpo-face-detector
, you may want to use this:addUnimodulesDependencies([exclude: ['expo-face-detector']])
I would like to avoid integrating with unnecessary modules and bloating my app. Since there is only a denyList exclude
option and not an allowList include
option- how can I get the full list of excludable modules?
Right now I have the following:
Podfile
# For enabling unimodules
use_unimodules!(
modules_paths: ...,
exclude: [
'expo-camera',
'expo-constants',
'expo-file-system',
'expo-image-loader',
# 'expo-local-authentication', # explicitly added for use
'expo-payments-stripe',
'expo-permissions',
# 'expo-secure-store', # explicitly added for use
'expo-video-thumbnails',
'unimodules-app-loader',
'unimodules-barcode-scanner-interface',
'unimodules-camera-interface',
# 'unimodules-constants-interface', # required by expo-local-authentication
'unimodules-face-detector-interface',
'unimodules-file-system-interface',
# 'unimodules-font-interface', # required by react-native-adapter (see https://github.com/expo/expo/blob/3d1fb0e3f94434d15c3fa70073bb496e82e7ac41/packages/%40unimodules/react-native-adapter/ios/UMReactNativeAdapter.podspec#L21)
'unimodules-image-loader-interface',
'unimodules-permissions-interface',
# 'unimodules-react-native-adapter', # required for expo modules
'unimodules-sensors-interface',
'unimodules-task-manager-interface'
]
app/build.gradle
addUnimodulesDependencies(
modulesPaths : ['../../../node_modules'],
exclude : [
'expo-camera',
'expo-constants',
'expo-file-system',
'expo-image-loader',
// 'expo-local-authentication', // explicitly added for use
'expo-payments-stripe',
'expo-permissions',
// 'expo-secure-store', // explicitly added for use
'expo-video-thumbnails',
// 'unimodules-app-loader', // required by react-native-adapter (android only)
'unimodules-barcode-scanner-interface',
'unimodules-camera-interface',
// 'unimodules-constants-interface', // required by expo-local-authentication
'unimodules-face-detector-interface',
'unimodules-file-system-interface',
// 'unimodules-font-interface', // required by react-native-adapter
// 'unimodules-image-loader-interface', // required by react-native-adapter (android only)
// 'unimodules-permissions-interface', // // required by react-native-adapter (android only)
// 'unimodules-react-native-adapter', // required for expo modules
'unimodules-sensors-interface',
'unimodules-task-manager-interface'
]
)
settings.gradle
includeUnimodulesProjects(
modulesPaths : ['../../../node_modules'],
exclude : [
'expo-camera',
'expo-constants',
'expo-file-system',
'expo-image-loader',
// 'expo-local-authentication', // explicitly added for use
'expo-payments-stripe',
'expo-permissions',
// 'expo-secure-store', // explicitly added for use
'expo-video-thumbnails',
// 'unimodules-app-loader', // required by react-native-adapter (android only)
'unimodules-barcode-scanner-interface',
'unimodules-camera-interface',
// 'unimodules-constants-interface', // required by expo-local-authentication
'unimodules-face-detector-interface',
'unimodules-file-system-interface',
// 'unimodules-font-interface', // required by react-native-adapter
// 'unimodules-image-loader-interface', // required by react-native-adapter (android only)
// 'unimodules-permissions-interface', // required by react-native-adapter (android only)
// 'unimodules-react-native-adapter', // required for expo modules
'unimodules-sensors-interface',
'unimodules-task-manager-interface'
]
)