spierce7
05/06/2020, 3:01 PMSean Keane
05/06/2020, 3:22 PMspierce7
05/06/2020, 6:12 PMSean Keane
05/06/2020, 7:09 PMSean Keane
05/06/2020, 7:11 PMspierce7
05/06/2020, 7:20 PMSean Keane
05/06/2020, 7:24 PMspierce7
05/06/2020, 7:27 PMspierce7
05/06/2020, 7:28 PMspierce7
05/06/2020, 7:28 PMSean Keane
05/06/2020, 7:28 PMspierce7
05/06/2020, 7:29 PMSean Keane
05/06/2020, 7:29 PMIlya Goncharov [JB]
05/07/2020, 7:10 AMprocessDceKotlinJs
It is available for browser
subtarget
And further you can disable webpack tasks and remove dependency from build
task on webpack
’s onesspierce7
05/07/2020, 1:47 PMspierce7
05/08/2020, 5:20 AMspierce7
05/08/2020, 5:21 AMIlya Goncharov [JB]
05/08/2020, 7:59 AMtasks.named("browserProductionWebpack") {
enabled = false
}
spierce7
05/08/2020, 4:18 PMremove the dependency from the build task
? I’m trying to understand all the pieces you are saying. Something like this should work to disable all the webpack tasks:
tasks.forEach {
if (it.name.contains("webpack", ignoreCase = true)) {
it.enabled = false
}
}
spierce7
05/08/2020, 4:20 PMbrowser {
webpackTask {
enabled = false
}
}
Ilya Goncharov [JB]
05/08/2020, 4:24 PMtasks.named("build") {
dependsOn.remove("browserProductionWebpack")
}
But seems that this behaviour is not supported in Gradle >6.0spierce7
05/08/2020, 4:29 PMspierce7
05/08/2020, 4:32 PMspierce7
05/08/2020, 4:32 PMtasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile::class) {
kotlinOptions {
sourceMap = true
metaInfo = false
}
}
Ilya Goncharov [JB]
05/08/2020, 4:35 PMsourceMap = true
Could you try wuth configureEach
?
tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile::class).configureEach {
kotlinOptions {
sourceMap = true
metaInfo = false
}
}
spierce7
05/08/2020, 4:38 PMspierce7
05/08/2020, 4:38 PMspierce7
05/08/2020, 4:39 PMplugins {
kotlin("js")
}
val outputDir = "$rootDir/../example/lib"
kotlin {
target {
useCommonJs()
browser {
webpackTask {
enabled = false
}
dceTask {
dceOptions {
outputDirectory = outputDir
}
}
}
}
sourceSets {
val main by getting {
dependencies {
implementation(Deps.kotlin.stdlib.js)
}
}
val test by getting {
dependencies {
implementation(Deps.kotlin.test.js)
}
}
}
}
tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile::class).configureEach {
kotlinOptions {
sourceMap = true
metaInfo = false
}
}
tasks.findByName("clean")!!.apply {
doFirst {
delete(outputDir)
}
doLast {
File(outputDir).mkdirs()
}
}
spierce7
05/08/2020, 4:42 PMIlya Goncharov [JB]
05/08/2020, 4:46 PMbuild/js/packages/module-name/kotlin
?spierce7
05/08/2020, 4:49 PMspierce7
05/08/2020, 5:09 PMIlya Goncharov [JB]
05/08/2020, 5:30 PM