Császár Ákos
11/21/2023, 10:08 AMjs(IR) {
browser {
webpackTask(Action {
mainOutputFileName.set("js-worker.js")
})
@OptIn(org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalDistributionDsl::class)
distribution(Action {
distributionName.set("jsWorker")
})
}
binaries.library()
binaries.executable()
}
I created another target for worker, so now I have 2.
val jsMain by getting {
resources.srcDirs("./build/jsWorker")
}
I also added the dependency for the jsWorker folder.
After build i can see that the js-worker.js file is generated in the projectRoot/common/build
folder.
But I want to publish it to npm, so i need to use the projectRoot/build
folder. Is it possible somehow to generate the js-worker.js file to the projectRoot/build
folder? Because if my guess is correct, the worker file wont be included, when I publish the project to npm.Artem Kobzar
11/21/2023, 10:50 AMEdoardo Luppi
11/21/2023, 11:08 AMEdoardo Luppi
11/21/2023, 11:10 AMCsászár Ákos
11/21/2023, 11:12 AMCsászár Ákos
11/21/2023, 11:17 AMEdoardo Luppi
11/21/2023, 11:18 AMbuild/frontend
.
You can obviously wire up tasks that are needed in your specific case, or simply copy distribution files to a common directoryEdoardo Luppi
11/21/2023, 11:18 AMEdoardo Luppi
11/21/2023, 11:20 AM