How to debug a plugin in remote development

As Jetbrains is introducing modular projects / remdev / gateway etc.

As introduced, plugin developer should migrate it into modular packages (frontend/backend/shared). But then how can I debug the plugin in a mocked client/remote headless IDE scenario?