We have a build matrix that compiles our project f...
# javascript
m
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
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
Ah, that could work. I didn't do much, basically using the default behaviour
m
On the other hand, I don't like "hardcoding" the dependencies manually because this might start failing with Kotlin 1.8
h
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
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
That works like a charm, thanks!