GarouDan
02/12/2019, 2:29 PM.gradle.kts
instead of .gradle
ones on my project. And I’m having a lot of doubts because of this.
How can I convert this to kts
?
kotlinFrontend {
downloadNodeJsVersion = 'latest'
sourceMaps = true
npm {
dependency "style-loader"
dependency("react")
dependency("react-dom")
devDependency("karma")
}
webpackBundle {
bundleName = "main"
contentPath = file('src/main/web')
}
}
Using something like task("kotlinFrontend") {
don’t work since the inner parts aren’t recognized.Lucas
02/12/2019, 5:38 PMkotlinFrontend
is a block to configure the frontend plugin, so it should be defined as kotlinFrontend { }
or configure<KotlinFrontendExtension> { }
. The task()
function is used to configure Gradle Tasks only.
I didn't tried, but maybe this sample could help. https://github.com/gyulavoros/kotlin-todomvc/blob/master/frontend/build.gradle.ktsGarouDan
02/12/2019, 6:35 PMgildor
02/13/2019, 3:15 AMIn general, to make it work you have to specify also type of task, but also it’s incorrect syntax, because this syntax, you have to say do you want to create or get existing taskdon’t work since the inner parts aren’t recognized.task("kotlinFrontend") {
gildor
02/13/2019, 3:15 AMgildor
02/13/2019, 3:15 AM