playcanvas / engine

JavaScript game engine built on WebGL, WebGPU, WebXR and glTF

Home Page:https://playcanvas.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Changes to engine output build files

kpal81xd opened this issue · comments

commented

Related #6292

Proposal

Engine package examples will now include the UMD version and ESM versions bundled for all build types (debug, profiler, release and min). Adding in the unbundled ESM build types increases the total packed package size from 10.8 MB to 12.9 MB. With the recent inclusion of the extras this issue proposes to modify the possible package files to be as follows

  • build/playcanvas.js
  • build/playcanvas.mjs
  • build/playcanvas.dbg.js
  • build/playcanvas.dbg.mjs
  • build/playcanvas.prf.js
  • build/playcanvas.prf.mjs
  • build/playcanvas.min.js
  • build/playcanvas.min.mjs
  • build/playcanvas.d.ts
  • src
  • build/playcanvas?

This structure implies that the unbundled builds of debug and profiler are obsolete since using the src directly will include both of these parts anyway. Since the src is unbundled, types will be directly included through the JSDoc and dead code will be tree shaken out anyway to reduce production build size.

If the overhead of having those profile and debug chunks is still to great the possibility of adding the unbundled release would remedy this however at the cost of increasing the engine package size.

The debug build has a significant performance impact, and that's the reason we're shipping a non-debug build.
Is there a problem to have a larger package size?

Package size is only really relevant when doing an npm i. So not particularly important.

commented

Will close as discussed minor increase in size not an issue