Using recast-detour package server side with null engine and typescript definitions

Currently there is some problem with the d.ts typings, as I get the following error:

'C:/projects/babylonjs-typescript-nullengine-example/node_modules/recast-detour/recast.d.ts' is not a module.

I created a small repo to illustrate this problem:

If you would be so kind to clone this and run the following commands, you should be able to see the error above:
npm install
npm run build

Rant warning: My use case for this is to use modern web technologies to build a multiplayer game. I am trying to use es module syntax as much as possible. I have a project structure like this:
image
As you can see, the project is a monorepo. In the packages/game, I have all the Babylon.js and game specific stuff, that the server and the client are both using (by importing required parts). Everything works pretty nicely, but all the problems stem from the Babylon.js plugins such as physics and now recast, that are not es modules at all. Added with TypeScript, everything seems really complex to set up. Is there any way that the emscripten created plugin packages could provide es module style npm repos. Es module style is also becoming a new standard, as, for example, @babylon/core package is already built this way.

And furthermore, for the game client, I can import the recast library with regular script tags that add the package to the window -variable. However, this is not the case in server side node.js environment. I’m pretty desperate at this point since I have lost many hours battling with the plugin problems without any viable solution :pensive: