How to reduce bundle size with Webpack?

I forgot what eval-source-maps do, but you can try just source-maps or one of the options that will split them in a separate file. As @drcmda pointed out, importing WebGLRenderer will import most of the library though. You can also compress the files, in which case, having a bundle may be better than having more files (i think it compresses better).

No idea of the answer to any of those questions. However, if you look at the examples that people post to this forum using JSFiddle or Codepen, a fairly high percentage of them still use script tags.

No, the dependency goes the other way. Examples extend from core:

If we convert Loader to a class, we have to convert everything in examples that extends from it to a class as well.

That means we need convert examples and src at the same time.

1 Like

Hi all has anybody achieved successful reduction of threejs bundle size in rollup yet? I have a tiny 3d scene for a small website but the bundle with rollup (sapper) is no smaller than 600 KB.

See https://github.com/mrdoob/three.js/issues/19986. Be sure to gzip the bundle — three.js should be about 150kb with gzip.

Anyone able to reduce the bundle size with webpack?