Typescript 300 Namespace Build Errors

Hi all, I am trying to build my project, wrote in typescript, into a single javascript file (as that is needed to actually put into production???) I am getting a ton of namespace errors when compiling, 399 to be exact. They all look like these:

node_modules/babylonjs-inspector/babylon.inspector.module.d.ts:3699:39 - error TS2694: Namespace ‘BABYLON’ has no exported member ‘IExplorerExtensibilityGroup’.

3699 extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup;
~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/babylonjs-inspector/babylon.inspector.module.d.ts:3711:39 - error TS2694: Namespace ‘BABYLON’ has no exported member ‘IExplorerExtensibilityGroup’.

3711 extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup;
~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/babylonjs-inspector/babylon.inspector.module.d.ts:3735:39 - error TS2694: Namespace ‘BABYLON’ has no exported member ‘IExplorerExtensibilityGroup’.

3735 extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup;
~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/babylonjs-inspector/babylon.inspector.module.d.ts:3736:25 - error TS2694: Namespace ‘BABYLON’ has no exported member ‘Nullable’.

3736 filter: BABYLON.Nullable;
~~~~~~~~

node_modules/babylonjs-inspector/babylon.inspector.module.d.ts:3759:25 - error TS2694: Namespace ‘BABYLON’ has no exported member ‘Nullable’.

3759 items?: BABYLON.Nullable<any>;
~~~~~~~~

node_modules/babylonjs-inspector/babylon.inspector.module.d.ts:3762:25 - error TS2694: Namespace ‘BABYLON’ has no exported member ‘Nullable’.

3762 filter: BABYLON.Nullable;
~~~~~~~~

node_modules/babylonjs-inspector/babylon.inspector.module.d.ts:3766:39 - error TS2694: Namespace ‘BABYLON’ has no exported member ‘IExplorerExtensibilityGroup’.

3766 extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup;
~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/babylonjs-inspector/babylon.inspector.module.d.ts:3789:24 - error TS2694: Namespace ‘BABYLON’ has no exported member ‘Scene’.

3789 scene: BABYLON.Scene;
~~~~~

node_modules/babylonjs-inspector/babylon.inspector.module.d.ts:3792:39 - error TS2694: Namespace ‘BABYLON’ has no exported member ‘IExplorerExtensibilityGroup’.

3792 extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup;
~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/babylonjs-inspector/babylon.inspector.module.d.ts:3793:48 - error TS2694: Namespace ‘BABYLON’ has no exported member ‘Observable’.

3793 onSelectionChangedObservable?: BABYLON.Observable;
~~~~~~~~~~

node_modules/babylonjs-inspector/babylon.inspector.module.d.ts:3827:24 - error TS2694: Namespace ‘BABYLON’ has no exported member ‘Scene’.

3827 scene: BABYLON.Scene;
~~~~~

node_modules/babylonjs-inspector/babylon.inspector.module.d.ts:3832:39 - error TS2694: Namespace ‘BABYLON’ has no exported member ‘IExplorerExtensibilityGroup’.

3832 extensibilityGroups?: BABYLON.IExplorerExtensibilityGroup;
~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/babylonjs-inspector/babylon.inspector.module.d.ts:3839:25 - error TS2694: Namespace ‘BABYLON’ has no exported member ‘Nullable’.

3839 filter: BABYLON.Nullable;
~~~~~~~~

node_modules/babylonjs-inspector/babylon.inspector.module.d.ts:3841:24 - error TS2694: Namespace ‘BABYLON’ has no exported member ‘Scene’.

3841 scene: BABYLON.Scene;
~~~~~

node_modules/babylonjs-inspector/babylon.inspector.module.d.ts:3866:24 - error TS2694: Namespace ‘BABYLON’ has no exported member ‘Scene’.

3866 scene: BABYLON.Scene;
~~~~~

node_modules/babylonjs-inspector/babylon.inspector.module.d.ts:3894:53 - error TS2694: Namespace ‘BABYLON’ has no exported member ‘Observable’.

3894 static OnSelectionChangeObservable: BABYLON.Observable;
~~~~~~~~~~

node_modules/babylonjs-inspector/babylon.inspector.module.d.ts:3895:53 - error TS2694: Namespace ‘BABYLON’ has no exported member ‘Observable’.

3895 static OnPropertyChangedObservable: BABYLON.Observable;
~~~~~~~~~~

node_modules/babylonjs-inspector/babylon.inspector.module.d.ts:3905:36 - error TS2694: Namespace ‘BABYLON’ has no exported member ‘Scene’.

3905 static Show(scene: BABYLON.Scene, userOptions: Partial<BABYLON.IInspectorOptions>): void;
~~~~~

node_modules/babylonjs-inspector/babylon.inspector.module.d.ts:3905:72 - error TS2694: Namespace ‘BABYLON’ has no exported member ‘IInspectorOptions’.

3905 static Show(scene: BABYLON.Scene, userOptions: Partial<BABYLON.IInspectorOptions>): void;
~~~~~~~~~~~~~~~~~

src/camera.ts:1:1 - error TS6131: Cannot compile modules using option ‘outFile’ unless the ‘–module’ flag is ‘amd’ or ‘system’.

1 import { ArcRotateCamera } from “@babylonjs/core/Cameras/arcRotateCamera”;

How do I resolve the issue and get this to compile? I don’t really know where to troubleshoot this. It’s my first real TS project.

What bundler do you use?

For anyone struggling with this these days, include this in your tsconfig.json:
{
“types”: [
“babylonjs”,
“babylonjs-gui”
],
}