Can compiler plugins generate code across multiplatform targets?

We have a multiplatform project where the JVM/common parts generate HTML, which references Javascript generated from the JS sourceset.
I would like to generate stubs for JS classes/functions. Those stubs would then be used in the JVM sources, to make references more convenient and “typesafe”.

From a developer POV, the nicest thing would be a compiler plugin that does this automatically.

But: can a compiler plugin create JVM (or common) code based on classes from the JS sourceset?

Unfortunately, compiler Plugins API is unstable and thus not supported. You can try it on your own risk, but I must warn you beforehand, that, up to this moment, we’ve never considered such use-cases, so, it might be even impossible to achieve such things in the current implementation