https://kotlinlang.org logo
#javascript
Title
# javascript
m

mbonnin

06/28/2022, 10:47 AM
We have a build matrix that compiles our project for both Kotlin 1.6 and Kotlin 1.7. Depending the Kotlin version, I get different npm dependencies in
kotlin-js-store
and
kotlinNpmInstall
. Is it possible to tell Kotlin 1.6 to use the 1.7 npm dependencies? Looks like no matter what I do, these dependencies are overwritten
1
h

hfhbd

06/28/2022, 10:50 AM
What have you tried so far? AFAIK you can overwrite the dependencies in Gradle: plugins.withType<NodeJsRootPlugin> { the<NodeJsRootExtension>().versions.apply { webpack.version = "5.73.0" webpackCli.version = "4.10.0" webpackDevServer.version = "4.9.2" karma.version = "6.4.0" } }
m

mbonnin

06/28/2022, 10:51 AM
Ah, that could work. I didn't do much, basically using the default behaviour
m

mbonnin

06/28/2022, 10:51 AM
On the other hand, I don't like "hardcoding" the dependencies manually because this might start failing with Kotlin 1.8
h

hfhbd

06/28/2022, 10:56 AM
What do you mean with might start failing? The versions are hardcoded in Kotlin Gradle Plugin: https://github.com/JetBrains/kotlin/commit/a84f70b3d86b81c8118872eabf2dfd034b6757f8 And of course, if you overwrite the version manually, you have to update them too
t

turansky

06/28/2022, 11:04 AM
On the other hand, I don’t like “hardcoding” the dependencies manually because this might start failing with Kotlin 1.8
You can configure different locations for
yarn.lock
files, like: •
lock_1.6/yarn.lock
lock_1.7/yarn.lock
Example
👀 1
👍 2
m

mbonnin

06/28/2022, 11:44 AM
That works like a charm, thanks!
2 Views