Closed LeXXik closed 1 month ago
I think that works as expected given all preloaded scripts will be included in the concatenated script file.
Does setting preload = false to the worker script fix this? That's the proposed way to treat worker script files on production builds too. There is rarely a reason to preload worker scripts since the worker will request the files separately.
Yes, it works correctly without concatenation. In our production builds, we download non-concatenated build and concatenate/minify it ourselves, so we have a control over what is concatenated.
Still could be useful in Launcher, when the project has many scripts, as loading is much faster with concatenated option in that case. Perhaps a boolean property could be added to script asset to be excluded from concatenation.
Edit: Leonidas, your suggestion on the forums is a good one, so adding here for record - the workaround would be to set the worker script preload to false.
The concatenate
flag will inline this, which will always be a problem when creating workers. You can probably get around this using URL.createObjectURL
with inline workers etc. Closing for now
Creating worker fails, when Launcher is started with "Concatenate Scripts" option:
Related forum: https://forum.playcanvas.com/t/new-worker-causing-build-fail/35411 Repro: https://playcanvas.com/project/1204252/overview/concatenation-issue