Changes to engine output build files
kpal81xd opened this issue · comments
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.
Will close as discussed minor increase in size not an issue