Is there a way to get the output JS file of a kotl...
# javascript
m
Is there a way to get the output JS file of a kotlin/js project to run with node?
e
Yes, if you're building with gradle it should be somewhere in the
<projectRoot>/build
folder. Not sure about the node target but the browser target puts everything in
project/build/distribution
I think the node package might get compiled to
build/js/packages/<project>
m
Can’t seem to be able to generate that file, I’ve tried both with kotlin 1.4.32 and 1.5.0
e
Take a look at the project setup docs and see if you're missing something. Can you link to your project or share your build file?
m
Yeah, I’ve read it multiple times but I can’t seem to figure out what I’m doing wrong. I’ll update the repo in a bit and post the link
a
It builds in the
$rootProject/build/js/packages/<project>/kotlin
, if doesn't help you can use https://github.com/mpetuska/npm-publish plugin, that outputs to
$subproject/build/publications/npm/js
outputs both typescript's d.ts file (if you're on IR) as well as compiled source 🙂
m
Eventually I could make it export it to that folder, but its not a single file, if I want to export this I need to get the whole js folder and move it. Unless there is a better way to deploy this into a server
a
The js exported is contained in one single file btw 👀
m
Not if you have multiple modules that are built locally 😐
😅 1
159 Views