https://kotlinlang.org logo
Title
c

Cru

04/01/2023, 10:45 AM
I created a kotlin multiplatform library then created a number of kotlin/js classes. How can I use the compiled kotlin/js code (module) in a different frontend application.
a

Arthur Krukowski

04/01/2023, 12:03 PM
I use multiplatform plugin, but for kotlin/js should be the same: You could generate a node library by using
jsNodeDevelopmentLibraryDistribution
gradle task and then import this library into another node project by declaring it as a dependency in package.json:
{
...
  "dependencies": {
    "mylib": "file:../build/developmentLibrary",
    ...
  }
}
c

Cru

04/01/2023, 1:14 PM
Its for the browser.
These are the built files. I have no idea how to include them in my html page as javascript code.