I'm working on sharing my models in a Ktor app, targeting the jsMain module, which will be called from a front-end written in React with Vite.
I used the KMP Wizard to generate the Ktor server and added the jsMain module manually. In the composeApp package's build.gradle.kts, I added this block to configure JavaScript:
In the shared module's build.gradle.kts, I only added:
js {
browser()
binaries.executable()
}
When I run jsBrowserProductionWebpack, it creates the kotlin.js bundle. However, I’m having trouble importing this JS file into my React project.
Any help would be greatly appreciated!
I'm working on sharing my models in a Ktor app, targeting the jsMain module, which will be called from a front-end written in React with Vite. I used the KMP Wizard to generate the Ktor server and added the jsMain module manually. In the composeApp package's build.gradle.kts, I added this block to configure JavaScript:
In the shared module's build.gradle.kts, I only added:
When I run jsBrowserProductionWebpack, it creates the
kotlin.js
bundle. However, I’m having trouble importing this JS file into my React project. Any help would be greatly appreciated!