Sorry noob question here but anybody has a idea of...
# javascript
b
Sorry noob question here but anybody has a idea of why when I compile my code, the output doesn't include the kotlin.js file? I had to copy it from the jar file which is not great in case I upgrade kotlin. Source code available at https://github.com/bmonjoie/magicsquare
k
You have to copy it from jar, however yo don't have to do it manually. Use Gradle,
Copy
task with
zipTree
source.
b
Thank you @konsoletyper for your answer. Maybe this should be mentioned in the documentation as it says the kotlin.js file should be part of the output. I'll update my script to copy it from the zipTree :-)
b
@bmo could you please share a link to the document you’re talking about?
b
@bashor
Examining the Compilation Output
When compiling (we'll use this term interchangeably with transpiling) to JavaScript, Kotlin outputs two main files:
kotlin.js. The runtime and standard library. This doesn't change between applications. It's tied to the version of Kotlin being used.
{module}.js. The actual code from the application. All files are compiled into a single JavaScript file which has the same name as the module.
https://kotlinlang.org/docs/tutorials/javascript/kotlin-to-javascript/kotlin-to-javascript.html
b
Got it, thank you
👍 1