# Large bundle size

**URL:** <https://community.cesium.com/t/large-bundle-size/10724>\
**Category:** CesiumJS\
**Created:** [August 27, 2020, 10:28am UTC](https://community.cesium.com/t/large-bundle-size/10724 "2020-08-27T10:28:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![attar.tal](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/attar.tal/32/3024_2.png) [@attar.tal](https://community.cesium.com/u/attar.tal)\
**Post date:** [August 27, 2020, 10:28am UTC](https://community.cesium.com/t/large-bundle-size/10724/1 "2020-08-27T10:28:27Z")

</div>

I imported the **Viewer module** (named import) using the webpack usedExports and the packages.json sideEffects properties.

my bundle was increased by approx. 23 MB.

Any idea how to handle that?

---

<div class="post-metadata">

**Author:** ![omar](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/omar/32/1999_2.png) [@omar](https://community.cesium.com/u/omar)\
**Post date:** [August 31, 2020, 11:42pm UTC](https://community.cesium.com/t/large-bundle-size/10724/2 "2020-08-31T23:42:44Z")

</div>

Have you checked our the release config in this Csium Webpack example? [https://github.com/CesiumGS/cesium-webpack-example](https://github.com/CesiumGS/cesium-webpack-example)

That should have the recommended settings to getting the bundle size as efficient as possible.

---

<div class="post-metadata">

**Author:** ![cywhale](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/cywhale/32/3417_2.png) [@cywhale](https://community.cesium.com/u/cywhale)\
**Post date:** [October 22, 2020, 12:52am UTC](https://community.cesium.com/t/large-bundle-size/10724/3 "2020-10-22T00:52:23Z")

</div>

Hi, I followed [webpack.release.config.js](https://github.com/CesiumGS/cesium-webpack-example/blob/master/webpack.release.config.js) and compression-webpack-plugin for Brotli compress

I got a biggest chunk (majorly Viewer) for 2.82 MB, (for Brotli 539KB, and for gzip 715KB), such as following figure

 ![擷取2](https://global.discourse-cdn.com/cesium/original/2X/e/e09a6f2b3433ea62fef485d382167f04ba8195c4.png)

The reproducible repo is [https://github.com/cywhale/preact\_cesium](https://github.com/cywhale/preact_cesium)

My webpack config is in [https://github.com/cywhale/preact\_cesium/blob/main/config/preact.config.js](https://github.com/cywhale/preact_cesium/blob/main/config/preact.config.js)

Is there any chance we can further reduce this main chunk size, or any other tips to split it to sub chunks, or just skip some unused modules that concatenated in cesium Viewer?  
Thanks.

---

<div class="post-metadata">

**Author:** ![TJ\_Koury](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/tj_koury/32/3280_2.png) [@TJ\_Koury](https://community.cesium.com/u/TJ_Koury)\
**Post date:** [November 5, 2020, 7:36pm UTC](https://community.cesium.com/t/large-bundle-size/10724/4 "2020-11-05T19:36:57Z")

</div>

Try out [c137.js](https://www.npmjs.com/package/c137.js), and keep in mind that all files are bundled including webworkers and images, so it should load very fast.

Example webpack setup [here](https://github.com/DigitalArsenal/cesium-webpack-example/tree/c137.js).
