Hi! How can I configure my project to output `.js`...
# javascript
k
Hi! How can I configure my project to output
.js
files ? So that I can include those file from in html files like
<script src="/static/kotlin.js"></script>
r
Generate the starter project for multiplatform fullstack web (with the new project wizard) and take a look at their build.gradle.kts. Off the top of my head, the important part is
browser { binaries.executable() }
and
outputFileName = "yourname.js"
on the
jsBrowserProductionWebpack
task to set the name.
👍 1
b
Or
Copy code
kotlin {
  js {
    moduleName = "main"
    browser {
      webpackTask {
        outputFileName = "$moduleName.js"
      }
      runTask {
        outputFileName = "$moduleName.js"
      }
    }
  }
}
👍 1
moduleName is optional