Open maxammann opened 3 years ago
The workaround is to revert to 0.4.0
@aeirola This is such a great plugin. What do you think the right approach is to fix this? I don't have a good feel for what that would look like, so I've just patched my local copy to skip the cleanup-- but I'd love to see this properly fixed. Thanks!
Hi, sorry for not reacting to this earlier. Not really using react native anymore, so maintenance of the plugin is unfortunately on hold at the moment.
I know that the cache functionality is a bit fragile, and apparently doesn't work properly in all metro bundling scenarios. Would definitely be good to improve on that.
While I don't have time to fix it myself, I'll be happy to accept PRs that improve the situation. Some possible approaches for solving the issue come to mind:
If anyone is familiar with the latest developments in react-native and metro, please share your thoughts on what kind of a solution would be suitable here. I unfortunately won't have time to familiarise myself with the current state of the react-native toolchain
The command
yarn react-native bundle --platform android --entry-file index.ts --bundle-output out
idles for at least a few minutes after it finished.I found out that the following lines are responsible for this: https://github.com/aeirola/react-native-svg-asset-plugin/blob/master/src/cache.js#L63-L67
This was introduced here: https://github.com/aeirola/react-native-svg-asset-plugin/pull/49/files
When building in release mode there should be no cleanup task scheduled.