kotlinJs + react frameworks (ex. Next.js, Docusaurus, Gatsby)


Is there a way to integrate a react frameworks with kotlinJs?
For example, I am considering Next.js, Docusaurus or Gatsby to generate react website in a gradle project with kotlinJs.

I see a common issue is that, react frameworks usually force to follow a strict project structure.

So, imo, the most generic way to integrate kotlinjs is to transpile kt files to js files without changing file structures. Then, the underlying framework will continue to process on the transpiled js files.

Technically, kotlinjs project should be just a normal js library. The only requirement of the library is that the output must keep the project structure, so the framework can continue to work on.

I think, we could implement a gradle plugin to connect the the kotlinjs output to serve as the input of the tasks to interact with the framework (ex. via framework CLI).

What do you think?