Kotlin / kotlin-frontend-plugin

Gradle Kotlin (http://kotlinlang.org) plugin for frontend development
Apache License 2.0
563 stars 69 forks source link

multi-module gradle build needs the webpack configuration to include resolution of sub modules output paths #79

Closed apatrida closed 6 years ago

apatrida commented 6 years ago

If you have a multi-module build in Gradle, and the module using webpack depends on another module. The current webpack configuration file that is created does not have a resolution entry for the dependent module. Therefore webpack fails.

JakeWharton commented 6 years ago

Presumably you aren't using the DCE plugin as well, right? Because it would have copied the transitive closure into build/kotlin-js-min/main allowing the entire graph to be resolved. I see this behavior when the DCE plugin isn't applied as well.

apatrida commented 6 years ago

it's odd and inconsistent. I need to go back and revisit it to see what patterns work or not. And no DCE plugin.

JakeWharton commented 6 years ago

This is the offending code:

https://github.com/Kotlin/kotlin-frontend-plugin/blob/d79762bd676d779de1759693ea7658886a4e7b2e/kotlin-frontend/src/main/kotlin/org/jetbrains/kotlin/gradle/frontend/webpack/GenerateWebPackConfigTask.kt#L74-L76

It needs to be made recursive. I'll take a shot.

apatrida commented 6 years ago

thanks @JakeWharton