Is it possible to use ES6 Babylon with web-loaded Inspector?

Hi,

I’m using ES6 Babylon, and using the Inspector as an ES6 module works as expected. That is, I’m using it by doing:

import '@babylonjs/inspector'

However, I use it very rarely and I find that importing the inspector module quadruples (!!!) by code bundle size (from 1.1MB to 4.2MB), as well as making full builds very slow.

Is it possible to load in the inspector (by specifying a URL somewhere to load the UMD or commonJS version of the module), when using ES6 Babylon?

Thanks!

Nope, you can not use the umd version in the es6 one but you could easily code split and side load it on demand only relying on dynamic imports: Code Splitting | webpack

This would then provide you with several js chuncks and the inspector could load only in response to a user action for instance providing you with both size and flexibility advantages.

1 Like