Commit 7af6da1
authored
chore(nx-dev): declare sitemap on build and deploy-build outputs (#35402)
## Current Behavior
`nx-dev:build` is a no-op aggregator over `sitemap` and `copy-redirects`
but only declares `{projectRoot}/.next` as its output. Tasks that depend
on `nx-dev:build` and use `dependentTasksOutputFiles` — e.g.
`astro-docs:validate-links`, which reads
`nx-dev/nx-dev/public/sitemap-0.xml` to cross-check links — never pick
up the sitemap as a declared input. Under sandboxing this surfaces as an
unexpected read, and it also means the sitemap doesn't participate in
the consumer's input hash.
Separately, `nx-dev:next:build` lists `public/sitemap*.xml` as an output
even though `next build` never writes sitemaps (the `sitemap` target
does). At best the glob captures nothing; at worst, on a re-run it
snapshots stale files from a previous build into `next:build`'s cache.
## Expected Behavior
`nx-dev:build` and `nx-dev:deploy-build` declare
`{projectRoot}/public/sitemap*.xml` alongside `{projectRoot}/.next`,
matching what their dependsOn chain actually produces. This mirrors the
existing `nx:noop` atomizer pattern used by `@nx/playwright` and
`@nx/cypress`, where the rollup target declares the superset of outputs
its children produce.
`nx:next:build` no longer claims an output it doesn't write.
Verified: `nx show target inputs astro-docs:validate-links --check
nx-dev/nx-dev/public/sitemap-0.xml nx-dev/nx-dev/public/sitemap.xml` now
reports both as inputs.1 parent 0ca6e3f commit 7af6da1
1 file changed
Lines changed: 3 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 19 | + | |
23 | 20 | | |
24 | 21 | | |
25 | 22 | | |
| |||
44 | 41 | | |
45 | 42 | | |
46 | 43 | | |
47 | | - | |
| 44 | + | |
48 | 45 | | |
49 | 46 | | |
50 | 47 | | |
51 | | - | |
| 48 | + | |
52 | 49 | | |
53 | 50 | | |
54 | 51 | | |
| |||
0 commit comments