Andreas Martin Mørch
09/19/2025, 12:22 PMimplementation(npm(package, version)) does not invalidate build cache?
Kotlin 2.2.0, Gradle 8.12
Running build before and after changing the NPM dependency shows the same build cache key for compileKotlinJs.
I would expect this to trigger a failed build and prompt the user to run kotlinUpgradeYarnLock like normal.Artem Kobzar
09/19/2025, 1:41 PMEdoardo Luppi
09/19/2025, 3:48 PMAndreas Martin Mørch
09/22/2025, 11:51 AMAdam Semenenko
09/22/2025, 7:42 PMcompileKotlinJs task.
npm dependencies are an input for other tasks, like Webpack bundling and executing tests.Christian Holmgaard Lund
03/04/2026, 2:47 PMjsBrowserProductionWebpack has the issue with not changing the cache key when changing the version of an npm implementation(npm(package, version)) .
We experienced this being an issue where we updated a dependency and ran jsBrowserProductionWebpack on a fresh ci pipeline with remote caching enabled, which resulted in a stale cache. I've fixed it by adding `package.json`and `yarn.lock.bak`to input of my KotlinWebpack tasks.
So it looks to me that npm dependencies are not inputs for other tasks, and can't find any immediate signs of these (or other versioning) files as inputs in the source code.
I'm still quite new with gradle and kotlin, so my assumption and methodologies might be wrong.Adam Semenenko
03/04/2026, 2:52 PMChristian Holmgaard Lund
03/04/2026, 2:57 PMChristian Holmgaard Lund
03/04/2026, 3:00 PMtasks.withType<KotlinWebpack>().configureEach {
inputs.file(layout.buildDirectory.file("tmp/jsPublicPackageJson/package.json"))
.withPropertyName("npmPackageJson")
.optional()
inputs.file(rootProject.file("yarn.lock.bak"))
.withPropertyName("yarnLockFile")
.optional()
}
Which makes the cache key depend on these files created by kotlinNpmInstall (or similar)Adam Semenenko
03/04/2026, 3:08 PMjsBrowserProductionWebpack task re-run if the npm dependencies change?Ilya Goncharov [JB]
03/04/2026, 3:11 PMAdam Semenenko
03/04/2026, 3:27 PMChristian Holmgaard Lund
03/04/2026, 3:52 PM