louiscad
06/22/2018, 5:14 PMbnorm
06/22/2018, 8:02 PMlouiscad
06/22/2018, 8:24 PMlex
06/23/2018, 6:04 AMgildor
06/23/2018, 5:48 PMlouiscad
06/23/2018, 7:09 PMgildor
06/24/2018, 9:46 AMlouiscad
06/24/2018, 9:56 AMgildor
06/25/2018, 1:04 AMI know I’ll need several modules to achieve that, but I don’t know how to make it work in the JS world@louiscad Each Kotlin JS module compiled to one
.js
file, so easiest way just include all of them. You can use webpack to combine them if you want, but probably you can start from a few files.lex
06/25/2018, 3:58 AMgildor
06/25/2018, 3:59 AMlex
06/25/2018, 3:59 AMkotlinFrontend {
sourceMaps = true
npm {
dependency("uuid", "^3.2.1")
}
webpackBundle {
bundleName = "main"
sourceMapEnabled = true
contentPath = file("$buildDir/bundle")
}
}
Script compilation errors:
Line 35: webpackBundle {
^ Unresolved reference: webpackBundle
Line 36: bundleName = "main"
^ Unresolved reference: bundleName
Line 37: sourceMapEnabled = true
^ Unresolved reference: sourceMapEnabled
Line 38: contentPath = file("$buildDir/bundle")
^ Unresolved reference: contentPath
accessors.kt
(gradle-kotlin-dsl-accessors
)kotlinFrontend
and npm
are theregildor
06/25/2018, 4:48 AMbundle
method.lex
06/25/2018, 4:50 AMgildor
06/25/2018, 4:50 AMkotlinFrontend {
bundle<WebPackBundler>("webpack") {
bundleName = "main"
}
}
lex
06/25/2018, 4:59 AMbundle<WebPackBundler>("webpack")
does not work, WebPackBundler
does not implement BundleConfig
fun <C : BundleConfig> bundle(id: String, configure: BundleConfig.() -> Unit) {
bundleBuilders += Pair(id, configure)
}
bundle<WebPackExtension>("webpack") {
bundleName = "main"
sourceMapEnabled = true
contentPath = file("$buildDir/bundle")
}
configure: BundleConfig.() -> Unit
should be configure: C.() -> Unit
gildor
06/25/2018, 5:03 AMbundle("webpack", delegateClosureOf<WebPackExtension> {
bundleName = "main"
})
lex
06/25/2018, 5:09 AMgildor
06/25/2018, 5:18 AMlex
06/25/2018, 5:29 AMgildor
06/25/2018, 6:04 AMlex
06/25/2018, 6:21 AMgildor
06/25/2018, 6:30 AMlex
06/25/2018, 6:35 AM