Open Danilo-Araujo-Silva opened 4 years ago
Hello
I think, the best way in your case would be to migrate to the 1.3.40+ Kotlin Gradle plugin, as from this version on, the NPM support is built-in, based on this frontend plugin. https://blog.jetbrains.com/kotlin/2019/06/kotlin-1-3-40-released/
Afaik, this plugin here is now EOL.
Regards
I was trying to use the new plugin but I wasn't been able to run the tests, either way I'll give it a try again and return.
If you have trouble to define test dependencies. It looks like, it's currently not possible to define test dependencies like production ones ... here a snipped from one of my projects i did solve it:
target {
compilations.all {
compileKotlinTask.kotlinOptions {
moduleKind = "amd"
sourceMap = true
}
}
browser {
webpackTask {
compilation.packageJson {
devDependencies["puppeteer"] = "2.0.0"
devDependencies["sockjs"] = "0.3.19"
}
}
testTask {
useKarma {
useChromeHeadless()
}
}
}
}
Hello
I think, the best way in your case would be to migrate to the 1.3.40+ Kotlin Gradle plugin, as from this version on, the NPM support is built-in, based on this frontend plugin. https://blog.jetbrains.com/kotlin/2019/06/kotlin-1-3-40-released/
Afaik, this plugin here is now EOL.
Regards
I have tried kotlin plugin 1.3.40, 1.3.50, 1.3.60, 1.3.61 and to be honest, the build is relatively slower. Building KotlinJs with the browser
and nodejs
targets is very impractical, as I have a huge app in production using kotlin. Every time I try switching to the next release, My code base take even longer to compile when I use gradle. So, I attempted to migrate to back to the frontend plugin as it relatively faster than. That or I am definitely doing something wrong.
That being said, may you please fix that so I may keep using it in prod? Whenever the current releases work for me, I will glady switch
@wem please please, I beg you this one time. We have a project that heavily depends on this plugin for now, I humbly request you to make it compatible with gradle 6+
When building with Gradle 6 I received the following error:
Which points to this part in the code.
From the Gradle code here we can see that this is actually final now and it suggests to use visitDependencies.
Can you please update the code accordingly?