How do I prevent forge.launchimage assets from being duplicated in my app?

StackOverflow https://stackoverflow.com/questions/19090080

  •  29-06-2022
  •  | 
  •  

سؤال

The forge.launchimage module requires that image assets live under the src/ directory of my app.

Unfortunately this results in the final build of my iOS app containing two copies of each of the image assets.

One copy in the package root renamed as Default--.png as well as the original image under src/.

With iOS requiring multiple resolutions of each asset the duplication starts to add up quickly.

Thank you!

هل كانت مفيدة؟

المحلول

Yep - even more painful with the new iOS 7 sizes!

If you don't re-use the launchimage files elsewhere in your app, you could use a postbuild hook to clean up those assets before we create the app. Something like this:

import glob
import shutil
import sys

def main(platform):
    if platform == "ios":
        for launch_dir in glob.glob("ios/*/assets/src/launch"):
            shutil.rmtree(launch_dir)

if __name__ == "__main__":
    main(sys.argv[1])
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top