Whilst the Babylon.js inspector is an amazing debug tool, it has the major downside, that it increases the bundle size by a very significant amount. That's why we only load the module on demand, using "dynamic imports". However this feature only works if the consuming codes build configuration supports dynamic imports!
Furthermore the inspector will only be loaded in "development" builds. This is a safety net for build configurations that cannot use dynamic imports for various reasons, which is the case for Combeenation configurators.
The 3d viewer control loads the viewer source from the CBN server if no "CustomJS" is involved. In order to make this work, the viewer source has to be bundled in one file, which eliminates the possibility of loading dynamic imports on demand.
There are now 2 different viewer sources available. The "development" version contains the inspector code and is used in configurator drafts. The "production" version is used in published configurators. This "production" build doesn't have the possibility to use the inspector for debugging, but it's much smaller and therefore faster.
If the viewer source is injected via "CustomJS", the user has to take care about the correct build type on his own! Depending on the CustomJS repository there are typically 2 main sripts:
npm run build
: Creates a "production" bundle without the inspectornpm run watch
: Injects local CustomJS in "development" mode into the configuratorIf you want to use the inspector you either need to use the locally injected CustomJS (?localcjs=true
) option or upload the
"development" build from npm run watch
or npm run build-dev
into your CustomJS
component.
Generated using TypeDoc