https://kotlinlang.org logo
#korge
Title
# korge
j

jeff

12/27/2020, 9:08 PM
Anyone have an example of adding an npm dependency to a Korge project? The Kotlin documentation says to use
npm()
but that doesn't seem to resolve.
d

Deactivated User

12/27/2020, 9:43 PM
never tried, but in the end korge just installs the kotlin multiplatform plugin, you should be able to put something like:
Copy code
dependencies {
    implementation(npm("react", "> 14.0.0 <=16.9.0"))
}
j

jeff

12/28/2020, 2:59 AM
I did get this figured out (my kotlin mp plugin was apply=false 🤦‍♂️ ) but I think I've suffered from the XY problem. I guess npm packages are for running headless, and what I should use instead is
<script src="MY_DEPENDENCY"></script>
(my day job is Android so don't know js too well.) So the next question is:
a

andylamax

12/28/2020, 5:49 AM
<script>
is not the recommended way. Find it's
npm
directory and use the method above
2 Views