babylon inspector bundle at https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js used to be a a bundle, but since inspector was refactored, it now has external dependencies that need to be accounted for - i suggest rebuilding bundle with those dependencies.
It is still a bundle, it needs the extra dependencies for some of is internal functionnalities. They are also all available on the CDN and you could lazy load them as well before the inspector only when you are trying to display the inspector I believe.
Embedding them in would break if ppl required the dependencies as well in their own app by having 2 versions of them.
Before, I believe we used a hackish solution to not have them mandatory and feature test everywhere and I totally understand why this could be more convenient.
Maybe @RaananW has a nice trick to lazy load them as well from the inspector package ?
There are a few issues here TBH - one is the direct dependencies in package.json (for example the GUI Editor, which is not being used by all inspector users for sure), the other one is async-loading them instead of importing them as being done right now. I will be happy to investigate a better way of doing that, but there are some limitations, because of the way we are packing and delivering.
Assigning to me, i’ll investigate.
ok, finally got some time to read through and investigate.
The bundle you are referring to is the UMD version, and it is expected that the dependencies (like the GUI lib) be loaded using UMD/in browser beforehand. So in your case, you could async-load those UMD dependencies together with the inspector, or not load them at all. The GUI Editor is the one exception - it is loaded async if it is not found in the global namespace.
But - if you work with a bundler and using our ES6 packages, there is no need to do all of this. Running this code will be enough: