b96ff8de2f
The way we currently track server CSS imports is to collect CSS files that each **module** depends on. This happens on the module graph level which is a global thing and cannot be tree-shaken properly (check the enabled test for more details). In this PR we collect another information, of CSS files that each **entrypoint** depends on. This is the CSS list after tree-shaken on the entry level. By intersecting these CSS imports with the module-level CSS imports, we can get the final used CSS imports for each _layout_. cc @hanneslund ## Bug - [ ] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md) |
||
---|---|---|
.. | ||
app | ||
app-alias | ||
app-edge | ||
app-prefetch | ||
app-rendering | ||
app-static | ||
asset-prefix | ||
next-font | ||
root-layout | ||
rsc-basic | ||
rsc-external | ||
trailingslash | ||
with-babel | ||
app-alias.test.ts | ||
app-edge.test.ts | ||
app-static.test.ts | ||
asset-prefix.test.ts | ||
index.test.ts | ||
next-font.test.ts | ||
prefetching.test.ts | ||
rendering.test.ts | ||
root-layout.test.ts | ||
rsc-basic.test.ts | ||
rsc-external.test.ts | ||
trailingslash.test.ts | ||
vercel-analytics.test.ts | ||
with-babel.test.ts |