Is there any clean way to conditionally import and enable the debug inspector depending on the environment (i.e. local dev vs production build)? I’m using webpack, ts and babel.
TS supports dynamic import expressions and there’s webpack plugins like webpack-inject-plugin but no matter what I’ve tried to date, as soon as I add those debug layer import statements, even if conditional, that code gets included in the bundle.
import "@babylonjs/inspector"; // canvas/engine/scene initialisation code ... scene.debugLayer.show();
How would I include this only for the dev build?