Cocos Creator 2.4.3 - is merge json working?

In the release notes for Cocos Creator 2.4.3, it says:

Optimize the size of the JSON file after construction, and merge all JSON, which can reduce the size of JSON by up to 30%

But I don’t see any changes between the previous builds, and I also don’t see what merge all JSON is doing. In my FBInstant builds, I still see multiple json files per bundle. Lots of json files for my app.

What exactly does merge all JSON do? Is there a way to get these json files compiled into 1? I think that would be a nice improvement in loading times for Cocos HTML5 builds.

You can see in my screenshot, assets/Attack is a bundle. There are 8 json files in subdirectories and another config.json in the main folder. So that’s 9 json files in a single asset bundle. I would expect those would be getting merged together.

Thanks!

image ,Merge All Json is a compression type of bundle

Hi SantyWang, thanks for the response!
I have tried both Merge All Json and Default for the compression type. Both options have the same result as in my screenshot - lots of different json files.

Maybe this doesn’t work for Facebook Instant builds?
Or maybe it’s merging some other json files together, not the ones from my screenshot?

Please find ‘Attack’ bundle in your editor, and make sure it is configured as follows.image

1 Like

Have you configured the Compress Type of your assets/Attack to Merge All JSON in the Properties panel? Like this:

image

1 Like

I figured it out. That build setting is a setting on every asset bundle. Setting it to Merge All Json now is giving me 1 json file per bundle =)
Awesome, thanks!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.