Large bundle size

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?

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

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

Hi, I followed 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

The reproducible repo is https://github.com/cywhale/preact_cesium

My webpack config is in 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.

Try out 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.

1 Like