unimonkiez / react-native-asset

Linking and unlinking of assets 🔥
302 stars 52 forks source link

Add an option of using symlinks for Android's raw directory #49

Open sergeymorkovkin opened 1 year ago

sergeymorkovkin commented 1 year ago

Symlinks could eliminate file duplication in a project directory.

unimonkiez commented 1 year ago

Not sure I understood the issue, can you elaborate?

sergeymorkovkin commented 1 year ago

@unimonkiez Resources get copied from their source directories to the respective Android's raw directory. Instead of copying these files (which are in our case are large enough), we could create sym-links at the destination path. I tried it on Android, and it worked.

trippingtarballs commented 1 year ago

Also not a fan of the copied artefacts. Duplicate files tracked under version control can cause confusion, and create opportunity for those files to get out of sync.

unimonkiez commented 1 year ago

Sounds like a good feature! will happily merge any PR in the subject

sergeymorkovkin commented 1 year ago

Yes, images get resized (so we have multiple-sized image files per one source image), but for sounds and fonts it's not justified at all... we're using symlinks already, and these work perfectly on MacOS.