Fix Moon webpack dependency cache invalidation#258940
Fix Moon webpack dependency cache invalidation#258940tylersmalley merged 4 commits intoelastic:mainfrom
Conversation
|
We were just talking about this caching invalidation behavior in Slack! My idea was to just add this to Looking at your solution, it's definitely better in that it doesn't invalidate the cache when changes in |
|
@tkajtoch, yeah I had considered that. There are thousands of dependencies and only a dozen or so in the shared deps, so my take was it was going to limit the cache hits enough for local development that it would negatively affect DX. |
|
Yeah, that makes sense. I wish this could be handled natively by moonrepo and it's probably the first time I ever thought "huh, bazel made it more convenient" lol. I like the approach you took to minimize cache misses and make it scoped to just the dependencies used in these packages. Thank you for putting this together! |
Moon cached webpack-built shared dependency bundles using only local source files and webpack config as inputs. When a dependency like @elastic/eui changed after bootstrap, Moon did not see any relevant input change for @kbn/ui-shared-deps-npm, so it could restore a stale cached bundle. That left the installed dependency tree newer than the built artifact, which is why code present under node_modules/@elastic/eui was missing from the emitted shared deps bundle. This change makes Moon invalidate those webpack bundle caches when, and only when, the actual resolved dependency graph for the bundle changes. Instead of keying off the entire workspace yarn.lock, it adds an exact transitive dependency fingerprint for each affected webpack-built package. That gives correct rebuilds for updated dependencies, including transitive ones, without broadly uncaching on unrelated lockfile churn.
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
⏳ Build in-progress, with failures
Failed CI StepsHistory
|
| - '^:build-webpack' | ||
| inputs: | ||
| - '@group(src)' | ||
| - 'package.json' |
There was a problem hiding this comment.
This refers to this project's package.json - did you mean that, or the root?
There was a problem hiding this comment.
Yeah, the package one as it contains the scripts.build and buildSourcePaths
| args: | ||
| - build | ||
| deps: | ||
| - extract-version-dependencies |
There was a problem hiding this comment.
While I think this is correct, this is probably not optimal. I believe this will always want to run before the webpack build. I guess it's ultimately the same, because we run this together with the version dependencies generation in the bootstrap step.
If you, however set up an input file dependency on the version_dependencies.txt the task will be cacheable so long as that file doesn't change. Did you try that variation?
There was a problem hiding this comment.
I can see the input dependency on version_dependencies.txt is set up transitively through being part of the src file group, maybe then this dep is not required?
There was a problem hiding this comment.
The dep is still required to bring version_dependencies.txt up-to-date, so it's technically a dependency here. The PR also changes bootstrap to run a single invocation of Moon, so in the end extract-version-dependencies should run at most once.
|
Starting backport for target branches: 8.19, 9.2, 9.3 https://github.com/elastic/kibana/actions/runs/23518006222 |
Moon cached webpack-built shared dependency bundles using only local source files and webpack config as inputs. When a dependency like `@elastic/eui` changed after bootstrap, Moon did not see any relevant input change for `@kbn/ui-shared-deps-npm`, so it could restore a stale cached bundle. That left the installed dependency tree newer than the built artifact, which is why code present under `node_modules/@elastic/eui` was missing from the emitted shared deps bundle. This change makes Moon invalidate those webpack bundle caches when, and only when, the actual resolved dependency graph for the bundle changes. Instead of keying off the entire workspace yarn.lock, it adds an exact transitive dependency fingerprint for each affected webpack-built package. That gives correct rebuilds for updated dependencies, including transitive ones, without broadly uncaching on unrelated lockfile churn. --------- Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co> (cherry picked from commit 41b1f04)
Moon cached webpack-built shared dependency bundles using only local source files and webpack config as inputs. When a dependency like `@elastic/eui` changed after bootstrap, Moon did not see any relevant input change for `@kbn/ui-shared-deps-npm`, so it could restore a stale cached bundle. That left the installed dependency tree newer than the built artifact, which is why code present under `node_modules/@elastic/eui` was missing from the emitted shared deps bundle. This change makes Moon invalidate those webpack bundle caches when, and only when, the actual resolved dependency graph for the bundle changes. Instead of keying off the entire workspace yarn.lock, it adds an exact transitive dependency fingerprint for each affected webpack-built package. That gives correct rebuilds for updated dependencies, including transitive ones, without broadly uncaching on unrelated lockfile churn. --------- Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co> (cherry picked from commit 41b1f04)
Moon cached webpack-built shared dependency bundles using only local source files and webpack config as inputs. When a dependency like `@elastic/eui` changed after bootstrap, Moon did not see any relevant input change for `@kbn/ui-shared-deps-npm`, so it could restore a stale cached bundle. That left the installed dependency tree newer than the built artifact, which is why code present under `node_modules/@elastic/eui` was missing from the emitted shared deps bundle. This change makes Moon invalidate those webpack bundle caches when, and only when, the actual resolved dependency graph for the bundle changes. Instead of keying off the entire workspace yarn.lock, it adds an exact transitive dependency fingerprint for each affected webpack-built package. That gives correct rebuilds for updated dependencies, including transitive ones, without broadly uncaching on unrelated lockfile churn. --------- Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co> (cherry picked from commit 41b1f04)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
This reverts commit 41b1f04.
…)" This reverts commit 0d3d288.
Moon cached webpack-built shared dependency bundles using only local source files and webpack config as inputs. When a dependency like `@elastic/eui` changed after bootstrap, Moon did not see any relevant input change for `@kbn/ui-shared-deps-npm`, so it could restore a stale cached bundle. That left the installed dependency tree newer than the built artifact, which is why code present under `node_modules/@elastic/eui` was missing from the emitted shared deps bundle. This change makes Moon invalidate those webpack bundle caches when, and only when, the actual resolved dependency graph for the bundle changes. Instead of keying off the entire workspace yarn.lock, it adds an exact transitive dependency fingerprint for each affected webpack-built package. That gives correct rebuilds for updated dependencies, including transitive ones, without broadly uncaching on unrelated lockfile churn. --------- Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co> (cherry picked from commit 41b1f04)
Moon cached webpack-built shared dependency bundles using only local source files and webpack config as inputs. When a dependency like `@elastic/eui` changed after bootstrap, Moon did not see any relevant input change for `@kbn/ui-shared-deps-npm`, so it could restore a stale cached bundle. That left the installed dependency tree newer than the built artifact, which is why code present under `node_modules/@elastic/eui` was missing from the emitted shared deps bundle. This change makes Moon invalidate those webpack bundle caches when, and only when, the actual resolved dependency graph for the bundle changes. Instead of keying off the entire workspace yarn.lock, it adds an exact transitive dependency fingerprint for each affected webpack-built package. That gives correct rebuilds for updated dependencies, including transitive ones, without broadly uncaching on unrelated lockfile churn. --------- Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co> (cherry picked from commit 41b1f04)
Moon cached webpack-built shared dependency bundles using only local source files and webpack config as inputs. When a dependency like `@elastic/eui` changed after bootstrap, Moon did not see any relevant input change for `@kbn/ui-shared-deps-npm`, so it could restore a stale cached bundle. That left the installed dependency tree newer than the built artifact, which is why code present under `node_modules/@elastic/eui` was missing from the emitted shared deps bundle. This change makes Moon invalidate those webpack bundle caches when, and only when, the actual resolved dependency graph for the bundle changes. Instead of keying off the entire workspace yarn.lock, it adds an exact transitive dependency fingerprint for each affected webpack-built package. That gives correct rebuilds for updated dependencies, including transitive ones, without broadly uncaching on unrelated lockfile churn. --------- Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co> (cherry picked from commit 41b1f04)
# Backport This will backport the following commits from `main` to `9.3`: - [Fix Moon webpack dependency cache invalidation (#258940)](#258940) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Tyler Smalley","email":"tyler.smalley@elastic.co"},"sourceCommit":{"committedDate":"2026-03-24T23:56:42Z","message":"Fix Moon webpack dependency cache invalidation (#258940)\n\nMoon cached webpack-built shared dependency bundles using only local source files and webpack config as inputs. When a dependency like `@elastic/eui` changed after bootstrap, Moon did not see any relevant\ninput change for `@kbn/ui-shared-deps-npm`, so it could restore a stale cached bundle. That left the installed dependency tree newer than the built artifact, which is why code present under\n`node_modules/@elastic/eui` was missing from the emitted shared deps bundle.\n\nThis change makes Moon invalidate those webpack bundle caches when, and only when, the actual resolved dependency graph for the bundle changes. Instead of keying off the entire workspace yarn.lock, it adds an exact\ntransitive dependency fingerprint for each affected webpack-built package. That gives correct rebuilds for updated dependencies, including transitive ones, without broadly uncaching on unrelated lockfile churn.\n\n---------\n\nSigned-off-by: Tyler Smalley <tyler.smalley@elastic.co>","sha":"41b1f045b52a2e3ab40fdf7d71cfb0f7b36eed09","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","v9.4.0"],"title":"Fix Moon webpack dependency cache invalidation","number":258940,"url":"https://github.com/elastic/kibana/pull/258940","mergeCommit":{"message":"Fix Moon webpack dependency cache invalidation (#258940)\n\nMoon cached webpack-built shared dependency bundles using only local source files and webpack config as inputs. When a dependency like `@elastic/eui` changed after bootstrap, Moon did not see any relevant\ninput change for `@kbn/ui-shared-deps-npm`, so it could restore a stale cached bundle. That left the installed dependency tree newer than the built artifact, which is why code present under\n`node_modules/@elastic/eui` was missing from the emitted shared deps bundle.\n\nThis change makes Moon invalidate those webpack bundle caches when, and only when, the actual resolved dependency graph for the bundle changes. Instead of keying off the entire workspace yarn.lock, it adds an exact\ntransitive dependency fingerprint for each affected webpack-built package. That gives correct rebuilds for updated dependencies, including transitive ones, without broadly uncaching on unrelated lockfile churn.\n\n---------\n\nSigned-off-by: Tyler Smalley <tyler.smalley@elastic.co>","sha":"41b1f045b52a2e3ab40fdf7d71cfb0f7b36eed09"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/258940","number":258940,"mergeCommit":{"message":"Fix Moon webpack dependency cache invalidation (#258940)\n\nMoon cached webpack-built shared dependency bundles using only local source files and webpack config as inputs. When a dependency like `@elastic/eui` changed after bootstrap, Moon did not see any relevant\ninput change for `@kbn/ui-shared-deps-npm`, so it could restore a stale cached bundle. That left the installed dependency tree newer than the built artifact, which is why code present under\n`node_modules/@elastic/eui` was missing from the emitted shared deps bundle.\n\nThis change makes Moon invalidate those webpack bundle caches when, and only when, the actual resolved dependency graph for the bundle changes. Instead of keying off the entire workspace yarn.lock, it adds an exact\ntransitive dependency fingerprint for each affected webpack-built package. That gives correct rebuilds for updated dependencies, including transitive ones, without broadly uncaching on unrelated lockfile churn.\n\n---------\n\nSigned-off-by: Tyler Smalley <tyler.smalley@elastic.co>","sha":"41b1f045b52a2e3ab40fdf7d71cfb0f7b36eed09"}}]}] BACKPORT--> Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co> Co-authored-by: Tyler Smalley <tyler.smalley@elastic.co>
Moon cached webpack-built shared dependency bundles using only local source files and webpack config as inputs. When a dependency like `@elastic/eui` changed after bootstrap, Moon did not see any relevant input change for `@kbn/ui-shared-deps-npm`, so it could restore a stale cached bundle. That left the installed dependency tree newer than the built artifact, which is why code present under `node_modules/@elastic/eui` was missing from the emitted shared deps bundle. This change makes Moon invalidate those webpack bundle caches when, and only when, the actual resolved dependency graph for the bundle changes. Instead of keying off the entire workspace yarn.lock, it adds an exact transitive dependency fingerprint for each affected webpack-built package. That gives correct rebuilds for updated dependencies, including transitive ones, without broadly uncaching on unrelated lockfile churn. --------- Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
This reverts commit 41b1f04.
…)" (elastic#259487) This reverts commit 0d3d288. --------- Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
Moon cached webpack-built shared dependency bundles using only local source files and webpack config as inputs. When a dependency like `@elastic/eui` changed after bootstrap, Moon did not see any relevant input change for `@kbn/ui-shared-deps-npm`, so it could restore a stale cached bundle. That left the installed dependency tree newer than the built artifact, which is why code present under `node_modules/@elastic/eui` was missing from the emitted shared deps bundle. This change makes Moon invalidate those webpack bundle caches when, and only when, the actual resolved dependency graph for the bundle changes. Instead of keying off the entire workspace yarn.lock, it adds an exact transitive dependency fingerprint for each affected webpack-built package. That gives correct rebuilds for updated dependencies, including transitive ones, without broadly uncaching on unrelated lockfile churn. --------- Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co> (cherry picked from commit 41b1f04)
Moon cached webpack-built shared dependency bundles using only local source files and webpack config as inputs. When a dependency like `@elastic/eui` changed after bootstrap, Moon did not see any relevant input change for `@kbn/ui-shared-deps-npm`, so it could restore a stale cached bundle. That left the installed dependency tree newer than the built artifact, which is why code present under `node_modules/@elastic/eui` was missing from the emitted shared deps bundle. This change makes Moon invalidate those webpack bundle caches when, and only when, the actual resolved dependency graph for the bundle changes. Instead of keying off the entire workspace yarn.lock, it adds an exact transitive dependency fingerprint for each affected webpack-built package. That gives correct rebuilds for updated dependencies, including transitive ones, without broadly uncaching on unrelated lockfile churn. --------- Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co> (cherry picked from commit 41b1f04)
# Backport This will backport the following commits from `main` to `9.2`: - [Fix Moon webpack dependency cache invalidation (#258940)](#258940) - [Fix yarn.lock v1 parser for compound package alias headers (#259640)](#259640) - [[CI] Fix moon cache usage (#259760)](#259760) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Tyler Smalley","email":"tyler.smalley@elastic.co"},"sourceCommit":{"committedDate":"2026-03-24T23:56:42Z","message":"Fix Moon webpack dependency cache invalidation (#258940)\n\nMoon cached webpack-built shared dependency bundles using only local source files and webpack config as inputs. When a dependency like `@elastic/eui` changed after bootstrap, Moon did not see any relevant\ninput change for `@kbn/ui-shared-deps-npm`, so it could restore a stale cached bundle. That left the installed dependency tree newer than the built artifact, which is why code present under\n`node_modules/@elastic/eui` was missing from the emitted shared deps bundle.\n\nThis change makes Moon invalidate those webpack bundle caches when, and only when, the actual resolved dependency graph for the bundle changes. Instead of keying off the entire workspace yarn.lock, it adds an exact\ntransitive dependency fingerprint for each affected webpack-built package. That gives correct rebuilds for updated dependencies, including transitive ones, without broadly uncaching on unrelated lockfile churn.\n\n---------\n\nSigned-off-by: Tyler Smalley <tyler.smalley@elastic.co>","sha":"41b1f045b52a2e3ab40fdf7d71cfb0f7b36eed09","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","v9.4.0"],"title":"Fix Moon webpack dependency cache invalidation","number":258940,"url":"https://github.com/elastic/kibana/pull/258940","mergeCommit":{"message":"Fix Moon webpack dependency cache invalidation (#258940)\n\nMoon cached webpack-built shared dependency bundles using only local source files and webpack config as inputs. When a dependency like `@elastic/eui` changed after bootstrap, Moon did not see any relevant\ninput change for `@kbn/ui-shared-deps-npm`, so it could restore a stale cached bundle. That left the installed dependency tree newer than the built artifact, which is why code present under\n`node_modules/@elastic/eui` was missing from the emitted shared deps bundle.\n\nThis change makes Moon invalidate those webpack bundle caches when, and only when, the actual resolved dependency graph for the bundle changes. Instead of keying off the entire workspace yarn.lock, it adds an exact\ntransitive dependency fingerprint for each affected webpack-built package. That gives correct rebuilds for updated dependencies, including transitive ones, without broadly uncaching on unrelated lockfile churn.\n\n---------\n\nSigned-off-by: Tyler Smalley <tyler.smalley@elastic.co>","sha":"41b1f045b52a2e3ab40fdf7d71cfb0f7b36eed09"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/258940","number":258940,"mergeCommit":{"message":"Fix Moon webpack dependency cache invalidation (#258940)\n\nMoon cached webpack-built shared dependency bundles using only local source files and webpack config as inputs. When a dependency like `@elastic/eui` changed after bootstrap, Moon did not see any relevant\ninput change for `@kbn/ui-shared-deps-npm`, so it could restore a stale cached bundle. That left the installed dependency tree newer than the built artifact, which is why code present under\n`node_modules/@elastic/eui` was missing from the emitted shared deps bundle.\n\nThis change makes Moon invalidate those webpack bundle caches when, and only when, the actual resolved dependency graph for the bundle changes. Instead of keying off the entire workspace yarn.lock, it adds an exact\ntransitive dependency fingerprint for each affected webpack-built package. That gives correct rebuilds for updated dependencies, including transitive ones, without broadly uncaching on unrelated lockfile churn.\n\n---------\n\nSigned-off-by: Tyler Smalley <tyler.smalley@elastic.co>","sha":"41b1f045b52a2e3ab40fdf7d71cfb0f7b36eed09"}}]}] BACKPORT--> --------- Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co> Co-authored-by: Tyler Smalley <tyler.smalley@elastic.co> Co-authored-by: Nick Partridge <nicholas.partridge@elastic.co> Co-authored-by: Alex Szabo <alex.szabo@elastic.co>
) # Backport This will backport the following commits from `main` to `8.19`: - [Fix Moon webpack dependency cache invalidation (#258940)](#258940) - [Fix yarn.lock v1 parser for compound package alias headers (#259640)](#259640) - [[CI] Fix moon cache usage (#259760)](#259760) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Tyler Smalley","email":"tyler.smalley@elastic.co"},"sourceCommit":{"committedDate":"2026-03-24T23:56:42Z","message":"Fix Moon webpack dependency cache invalidation (#258940)\n\nMoon cached webpack-built shared dependency bundles using only local source files and webpack config as inputs. When a dependency like `@elastic/eui` changed after bootstrap, Moon did not see any relevant\ninput change for `@kbn/ui-shared-deps-npm`, so it could restore a stale cached bundle. That left the installed dependency tree newer than the built artifact, which is why code present under\n`node_modules/@elastic/eui` was missing from the emitted shared deps bundle.\n\nThis change makes Moon invalidate those webpack bundle caches when, and only when, the actual resolved dependency graph for the bundle changes. Instead of keying off the entire workspace yarn.lock, it adds an exact\ntransitive dependency fingerprint for each affected webpack-built package. That gives correct rebuilds for updated dependencies, including transitive ones, without broadly uncaching on unrelated lockfile churn.\n\n---------\n\nSigned-off-by: Tyler Smalley <tyler.smalley@elastic.co>","sha":"41b1f045b52a2e3ab40fdf7d71cfb0f7b36eed09","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","v9.4.0"],"title":"Fix Moon webpack dependency cache invalidation","number":258940,"url":"https://github.com/elastic/kibana/pull/258940","mergeCommit":{"message":"Fix Moon webpack dependency cache invalidation (#258940)\n\nMoon cached webpack-built shared dependency bundles using only local source files and webpack config as inputs. When a dependency like `@elastic/eui` changed after bootstrap, Moon did not see any relevant\ninput change for `@kbn/ui-shared-deps-npm`, so it could restore a stale cached bundle. That left the installed dependency tree newer than the built artifact, which is why code present under\n`node_modules/@elastic/eui` was missing from the emitted shared deps bundle.\n\nThis change makes Moon invalidate those webpack bundle caches when, and only when, the actual resolved dependency graph for the bundle changes. Instead of keying off the entire workspace yarn.lock, it adds an exact\ntransitive dependency fingerprint for each affected webpack-built package. That gives correct rebuilds for updated dependencies, including transitive ones, without broadly uncaching on unrelated lockfile churn.\n\n---------\n\nSigned-off-by: Tyler Smalley <tyler.smalley@elastic.co>","sha":"41b1f045b52a2e3ab40fdf7d71cfb0f7b36eed09"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/258940","number":258940,"mergeCommit":{"message":"Fix Moon webpack dependency cache invalidation (#258940)\n\nMoon cached webpack-built shared dependency bundles using only local source files and webpack config as inputs. When a dependency like `@elastic/eui` changed after bootstrap, Moon did not see any relevant\ninput change for `@kbn/ui-shared-deps-npm`, so it could restore a stale cached bundle. That left the installed dependency tree newer than the built artifact, which is why code present under\n`node_modules/@elastic/eui` was missing from the emitted shared deps bundle.\n\nThis change makes Moon invalidate those webpack bundle caches when, and only when, the actual resolved dependency graph for the bundle changes. Instead of keying off the entire workspace yarn.lock, it adds an exact\ntransitive dependency fingerprint for each affected webpack-built package. That gives correct rebuilds for updated dependencies, including transitive ones, without broadly uncaching on unrelated lockfile churn.\n\n---------\n\nSigned-off-by: Tyler Smalley <tyler.smalley@elastic.co>","sha":"41b1f045b52a2e3ab40fdf7d71cfb0f7b36eed09"}}]}] BACKPORT--> --------- Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co> Co-authored-by: Tyler Smalley <tyler.smalley@elastic.co> Co-authored-by: Nick Partridge <nicholas.partridge@elastic.co> Co-authored-by: Alex Szabo <alex.szabo@elastic.co>
…)" (elastic#259487) This reverts commit 0d3d288. --------- Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
…)" (elastic#259487) This reverts commit 0d3d288. --------- Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
Moon cached webpack-built shared dependency bundles using only local source files and webpack config as inputs. When a dependency like
@elastic/euichanged after bootstrap, Moon did not see any relevant input change for@kbn/ui-shared-deps-npm, so it could restore a stale cached bundle. That left the installed dependency tree newer than the built artifact, which is why code present undernode_modules/@elastic/euiwas missing from the emitted shared deps bundle.This change makes Moon invalidate those webpack bundle caches when, and only when, the actual resolved dependency graph for the bundle changes. Instead of keying off the entire workspace yarn.lock, it adds an exact transitive dependency fingerprint for each affected webpack-built package. That gives correct rebuilds for updated dependencies, including transitive ones, without broadly uncaching on unrelated lockfile churn.