# Reduce the bundle size

**URL:** <https://forum.defold.com/t/reduce-the-bundle-size/70603>\
**Category:** Questions\
**Created:** [March 23, 2022, 11:19am UTC](https://forum.defold.com/t/reduce-the-bundle-size/70603 "2022-03-23T11:19:11Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lecricreator](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/lecricreator/32/24037_2.png) [@Lecricreator](https://forum.defold.com/u/Lecricreator)\
**Post date:** [March 23, 2022, 11:19am UTC](https://forum.defold.com/t/reduce-the-bundle-size/70603/1 "2022-03-23T11:19:11Z")

</div>

Hey everyone,  
I try to create a bundle HTML5 for an web plateform.  
The problem is that my initial download is so heavy. (he advises - 15Mb) .  
 ![image](https://forum-defold-uploads.b-cdn.net/original/3X/f/b/fbb8aef3295c9ed64babb4dd9b35534b96e09dde.png)

How reduce the size of file ?  
I’ve heard an lazy/progressive loading, but i don’t know how use.

 ![image](https://forum-defold-uploads.b-cdn.net/original/3X/d/d/dd1532fb429acb80afa5da8d24a470c3c2ed1824.png)  
 ![image](https://forum-defold-uploads.b-cdn.net/original/3X/4/a/4a2a33cff17f500f866fcfe2e19716bbac380207.png)

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [March 23, 2022, 11:28am UTC](https://forum.defold.com/t/reduce-the-bundle-size/70603/2 "2022-03-23T11:28:54Z")

</div>

Are you using texture compression?  
Have you stripped unused functionality from the engine? (See [Defold App Manifest generator](https://britzl.github.io/manifestation/))

Edit: I see it’s mostly the fmod sound banks taking up space? Not sure what setting fmod provides?

---

<div class="post-metadata">

**Author:** ![Lecricreator](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/lecricreator/32/24037_2.png) [@Lecricreator](https://forum.defold.com/u/Lecricreator)\
**Post date:** [March 23, 2022, 12:38pm UTC](https://forum.defold.com/t/reduce-the-bundle-size/70603/3 "2022-03-23T12:38:43Z")

</div>

> [@Mathias\_Westerdahl](#):
>
> Have you stripped unused functionality from the engine? (See [Defold App Manifest generator](https://britzl.github.io/manifestation/))

Ok, I lost 2kb with app manifest.

 ![image](https://forum-defold-uploads.b-cdn.net/original/3X/6/9/69494ada467d9f473343ab2ab4d2edcd54cebbb6.png)  
 ![image](https://forum-defold-uploads.b-cdn.net/original/3X/a/f/af4d3291c21efa6de4764d1bc82bd2d01643f7ba.png)

I’m going to discover compression texture on Defold and research with fmod.

---

<div class="post-metadata">

**Author:** ![Lecricreator](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/lecricreator/32/24037_2.png) [@Lecricreator](https://forum.defold.com/u/Lecricreator)\
**Post date:** [March 23, 2022, 12:42pm UTC](https://forum.defold.com/t/reduce-the-bundle-size/70603/4 "2022-03-23T12:42:35Z")

</div>

![image](https://forum-defold-uploads.b-cdn.net/original/3X/2/8/28187403e95b494de8a5770c065004370f0abd83.png)  
And i’ve this, but I don’t know what it can do for me.

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [March 23, 2022, 1:15pm UTC](https://forum.defold.com/t/reduce-the-bundle-size/70603/5 "2022-03-23T13:15:03Z")

</div>

> [@Lecricreator](#):
>
> Ok, I lost 2kb with app manifest.

Have you used an app manifest before?  
2kb frankly seems a little small, after removing the two physics engines 🤔

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [March 23, 2022, 1:16pm UTC](https://forum.defold.com/t/reduce-the-bundle-size/70603/6 "2022-03-23T13:16:54Z")

</div>

That show that you have large textures. Either look into texture compression, and/or making your textures smaller.

---

<div class="post-metadata">

**Author:** ![Lecricreator](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/lecricreator/32/24037_2.png) [@Lecricreator](https://forum.defold.com/u/Lecricreator)\
**Post date:** [March 23, 2022, 2:27pm UTC](https://forum.defold.com/t/reduce-the-bundle-size/70603/7 "2022-03-23T14:27:19Z")

</div>

> [@Mathias\_Westerdahl](#):
>
> Have you used an app manifest before?  
> 2kb frankly seems a little small, after removing the two physics engines

 ![image](https://forum-defold-uploads.b-cdn.net/original/3X/4/c/4c19a33872bbb5b478c7d2610d26dd988fec4b2f.png)  
I never use app manifest.

I try to compress image.

 ![image](https://forum-defold-uploads.b-cdn.net/original/3X/c/f/cf7548f55076256076911ab35937fd3d496743f9.png)

What size screen you recommended for mobile and HTML5 ?  
For the moment I’m in 1280x720.

 ![image](https://forum-defold-uploads.b-cdn.net/original/3X/a/6/a69375714a2208306267a53ac7a613b9767f800d.png)

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [March 23, 2022, 2:33pm UTC](https://forum.defold.com/t/reduce-the-bundle-size/70603/8 "2022-03-23T14:33:21Z")

</div>

> [@Lecricreator](#):
>
> I never use app manifest.

But did you add it to game.project in the Native Extension section?

---

<div class="post-metadata">

**Author:** ![Lecricreator](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/lecricreator/32/24037_2.png) [@Lecricreator](https://forum.defold.com/u/Lecricreator)\
**Post date:** [March 23, 2022, 2:40pm UTC](https://forum.defold.com/t/reduce-the-bundle-size/70603/9 "2022-03-23T14:40:21Z")

</div>

Yes, he’s in my game project.

 ![image](https://forum-defold-uploads.b-cdn.net/original/3X/e/d/edb51ef0f9d7a985061ad638b5b086f9b8488e13.png)

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [March 23, 2022, 2:48pm UTC](https://forum.defold.com/t/reduce-the-bundle-size/70603/10 "2022-03-23T14:48:59Z")

</div>

Strange. Like @JCash wrote I too would have expected the size to be reduced more when you removed the physics engines.

---

<div class="post-metadata">

**Author:** ![Lecricreator](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/lecricreator/32/24037_2.png) [@Lecricreator](https://forum.defold.com/u/Lecricreator)\
**Post date:** [March 23, 2022, 3:02pm UTC](https://forum.defold.com/t/reduce-the-bundle-size/70603/11 "2022-03-23T15:02:57Z")

</div>

😑 😑  
I wish it had been reduce the size.  
I try to reduce the size image.

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [March 23, 2022, 3:03pm UTC](https://forum.defold.com/t/reduce-the-bundle-size/70603/12 "2022-03-23T15:03:46Z")

</div>

Start with the texture compression first!

---

<div class="post-metadata">

**Author:** ![Lecricreator](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/lecricreator/32/24037_2.png) [@Lecricreator](https://forum.defold.com/u/Lecricreator)\
**Post date:** [March 23, 2022, 3:08pm UTC](https://forum.defold.com/t/reduce-the-bundle-size/70603/13 "2022-03-23T15:08:19Z")

</div>

> [@Mathias\_Westerdahl](#):
>
> texture compression

What you recommended tinyjpg, in Defold or other ?

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [March 23, 2022, 3:12pm UTC](https://forum.defold.com/t/reduce-the-bundle-size/70603/14 "2022-03-23T15:12:59Z")

</div>

No, we unpack the images anyways when we create the atlas texture.

What I’m referring to is the use of GPU texture compression.  
You configure it using [texture profiles](https://defold.com/manuals/texture-profiles/).  
Use the UASTC compression type, and set up rules for your RGB/RGBA textures accordingly.

---

<div class="post-metadata">

**Author:** ![Lecricreator](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/lecricreator/32/24037_2.png) [@Lecricreator](https://forum.defold.com/u/Lecricreator)\
**Post date:** [March 23, 2022, 3:51pm UTC](https://forum.defold.com/t/reduce-the-bundle-size/70603/15 "2022-03-23T15:51:33Z")

</div>

Ok, i’ve made this, but i don’t see of big difference.

 ![image](https://forum-defold-uploads.b-cdn.net/original/3X/e/0/e06f4705a300825fd257542858159b88cc7f4730.png)  
 ![image](https://forum-defold-uploads.b-cdn.net/original/3X/d/1/d1e42e8760db318b7351e9e8f47b6bbbb3f9d921.png)

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [March 23, 2022, 3:58pm UTC](https://forum.defold.com/t/reduce-the-bundle-size/70603/16 "2022-03-23T15:58:15Z")

</div>

When you open your atlas in the editor, you should see which texture profile it’s using?  
It should be displayed at the top left of the viewport.

Here I have mapped the paths like so:

```lua
path_settings {
  path: "/level_1/**/*_rgb.atlas"
  profile: "Basis_RGB"
}

```

And I have a profile called `Basis_RGB`:

```lua
profiles {
  name: "Basis_RGB"
  platforms {
    os: OS_ID_GENERIC
    formats {
      format: TEXTURE_FORMAT_RGB
      compression_level: FAST
      compression_type: COMPRESSION_TYPE_BASIS_UASTC
    }
    mipmaps: true
    max_texture_size: 0
    premultiply_alpha: true
  }
}

```

ANd, in my project, when opening an atlas under my “level1” folder, with the ending “\_rgb.atlas”, it gets properly mapped:

 ![Screenshot 2022-03-23 at 16.54.03](https://forum-defold-uploads.b-cdn.net/original/3X/a/9/a921c1e033976946459e9ef0a23ad95b60002ac3.png)

Also note that often it’s enough to use the same settings on all platforms (i.e. using OS\_ID\_GENERIC).
