https://kotlinlang.org logo
#javascript
Title
# javascript
d

David Smith

01/28/2023, 9:51 AM
I have a full stack kotlin/gradle project and in it I have a module that contains some a javascript file and
JsModule
kotlin file. I’m trying to work out how to get my top level build to depend on and include the javascript file as well as the
JsModule
kotlin in this module? All I can find on the internet is how to depend on an npm library but nothing about a local javascript file 😞
a

Adam S

01/28/2023, 10:13 AM
what config do you have at the moment? What have you tried to do?
d

David Smith

01/30/2023, 11:51 AM
I managed it in the end, it wasn’t easy to find but basically you add an
npm("module-name", project.file("src/jsMain/resources/my-module")
but I had to create an npm module in
src/jsMain/resources/my-module
with a package.json etc (actually I just ran
npm init
)
3 Views