Open JakeWharton opened 5 years ago
For now I'm using
allprojects {
// TODO remove once https://github.com/Kotlin/kotlin-frontend-plugin/issues/141 is fixed
plugins.whenPluginAdded { plugin ->
if (plugin.class.name == 'org.jetbrains.kotlin.gradle.frontend.FrontendPlugin') {
def fixTask = tasks.register('webpack-config-fix') {
it.doLast { file('webpack.config.d').mkdir() }
}
afterEvaluate {
tasks.named('webpack-config').configure {
it.dependsOn(fixTask)
}
}
}
}
}
Fix for Gradle Kotlin DSL (based on @JakeWharton answer)
// TODO remove once https://github.com/Kotlin/kotlin-frontend-plugin/issues/141 is fixed
plugins.whenPluginAdded {
if (this.javaClass.name == "org.jetbrains.kotlin.gradle.frontend.FrontendPlugin") {
val fixTask = tasks.register("webpack-config-fix") {
this.doLast { file("webpack.config.d").mkdir() }
}
afterEvaluate {
tasks.named("webpack-config").configure {
this.dependsOn(fixTask)
}
}
}
}
Gradle 5.2, Kotlin 1.3.21, kotlin-frontend-plugin 0.0.45
When my modules using the frontend plugin do not have a
webpack.config.d
directory Gradle fails to validate the task:Adding an empty
webpack.config.d
directory solves the problem, but should not be required.