Created
November 21, 2023 19:57
-
-
Save felippewick/23c444fd409285d0a993221e517bf269 to your computer and use it in GitHub Desktop.
expo plugin: shared element transition & @react-native-firebase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const plugins = require('expo/config-plugins') | |
const { | |
mergeContents, | |
} = require('@expo/config-plugins/build/utils/generateCode') | |
const path = require('path') | |
const fs = require('fs') | |
module.exports = function withReanimatedUseFrameworks(config) { | |
return plugins.withDangerousMod(config, [ | |
'ios', | |
async (config) => { | |
const filePath = path.join( | |
config.modRequest.platformProjectRoot, | |
'Podfile', | |
) | |
const contents = fs.readFileSync(filePath, 'utf-8') | |
const preInstall = mergeContents({ | |
tag: "reanimated_rnfirebase", | |
src: contents, | |
newSrc: [ | |
`pre_install do |installer|`, | |
`installer.pod_targets.each do |pod|`, | |
`if pod.name.eql?('RNScreens')`, | |
`def pod.build_type`, | |
`Pod::BuildType.static_library`, | |
`end`, | |
`end`, | |
`end`, | |
`end`, | |
].join('\n'), | |
offset: 0, | |
anchor: " flags = get_default_flags()", | |
comment: '#', | |
}) | |
fs.writeFileSync(filePath, preInstall.contents) | |
return config | |
}, | |
]) | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment