cognitedata / reveal

Cognite Reveal 3D viewer

Home Page:https://cognitedata.github.io/reveal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reveal Examples has a ouput bundle.js of 45 megabytes

Strepto opened this issue · comments

The examples/public/bundle.js from a fresh-ish clone of Reveal is 45 megabytes on my system. This makes working with the Examples viewer kinda slow as my browser has to load this gigantic file each time I refresh.

Tested on current master: 39fd25e

repro:

  • cd viewer && yarn && yarn build:watch
  • cd examples && yarn && yarn run start

See examples/public/bundle.js file size

Any ideas of whats causing this gigantic bundle, and if its possible to reduce it? I have not looked into the issue because I assume you have some kind of fix if you actually use the examples viewer :D

Usually isn't any large issue for me at least. I am suspecting almost all of it is due to source maps. Can you try building reveal in production yarn run build:prod in /viewer to see if that fixes anything?

Hmm, it might be that the file in "public" should not be there at all. When I delete it, its no longer re-created. Closing this until I have some more data on what could be wrong.

Sorry to bother.

@Strepto Think it is ok to keep open. Clearly something is wrong here. When building in development mode the viewer/dist is huge. Production build seems fine though.

As for the bundle.js, it is also present when building examples (it is only temp when running yarn start). So it will re-appear if you build.

We've redone how we handle source maps in #2610 - We no longer generate source maps for workers and Javascript files by default, bringing the size of the index.js bundle down from 30 MB to ~8MB.