Specifying the output files

Now, it's very important where your output will be generated once you trigger the build. For that, build.gradle will help us. Specify the following lines in your module-level build.gradle file. 

The backend module's build.gradle will have the following lines of code:

    compileKotlin2Js {      kotlinOptions.outputFile = "${projectDir}/server/app.js"      kotlinOptions.moduleKind = "commonjs"      kotlinOptions.sourceMap = true    }

The webapp module's build.gradle will have the following lines of code:

    compileKotlin2Js {      kotlinOptions.metaInfo = true      kotlinOptions.outputFile = "${projectDir}/js/main.js"      kotlinOptions.sourceMap = true      kotlinOptions.main = "call"    }

In both the compileKotlin2Js nodes, kotlinOptions.outputFile plays ...

Get Kotlin Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.