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 PMgildor
06/23/2018, 5:51 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 AMlex
06/25/2018, 4:00 AMkotlinFrontend {
sourceMaps = true
npm {
dependency("uuid", "^3.2.1")
}
webpackBundle {
bundleName = "main"
sourceMapEnabled = true
contentPath = file("$buildDir/bundle")
}
}lex
06/25/2018, 4:00 AMScript 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: contentPathlex
06/25/2018, 4:10 AMaccessors.kt (gradle-kotlin-dsl-accessors)lex
06/25/2018, 4:10 AMkotlinFrontend and npm are theregildor
06/25/2018, 4:48 AMgildor
06/25/2018, 4:49 AMbundle method.lex
06/25/2018, 4:50 AMgildor
06/25/2018, 4:50 AMkotlinFrontend {
bundle<WebPackBundler>("webpack") {
bundleName = "main"
}
}gildor
06/25/2018, 4:51 AMgildor
06/25/2018, 4:51 AMlex
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)
}lex
06/25/2018, 5:00 AMbundle<WebPackExtension>("webpack") {
bundleName = "main"
sourceMapEnabled = true
contentPath = file("$buildDir/bundle")
}lex
06/25/2018, 5:01 AMconfigure: BundleConfig.() -> Unit should be configure: C.() -> Unitgildor
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 AMlex
06/25/2018, 5:55 AMgildor
06/25/2018, 6:04 AMgildor
06/25/2018, 6:05 AMlex
06/25/2018, 6:21 AMlex
06/25/2018, 6:24 AMgildor
06/25/2018, 6:30 AMlex
06/25/2018, 6:35 AMlex
06/25/2018, 6:35 AM