ribesg
07/01/2022, 3:06 PMbrowser {}
. If I want to write a NodeJS server in Kotlin/JS, I use nodejs {}
.
But what do you use for “pure” libraries? What if I want to remake something like Moment.js from scratch? Or a simple algorithm implementation? It can be used both in the browser or in a nodejs server, it’s “just pure js”. How do you configure a project like that? Do you target one or the other, or both? Does it make a difference?ephemient
07/01/2022, 5:04 PMkotlin {
js {
nodejs()
browser()
it makes a difference as to which APIs (e.g. on window
) the Kotlin compiler treats as available, but they're currently compiled the sameribesg
07/01/2022, 5:13 PM