f7069c0279
Reported by @hanneslund, when a CSS modules file gets imported in server components, during `collectClientComponentsAndCSSForDependency` in our client entry plugin it will always be collected no matter it is used or not. Due to the restriction that we have to collect these imports to create the client entry, it has to run in the `finishMake` compiler phase and at that time, module optimization hasn't started yet. To fix that issue, we run another pass in `afterOptimizeModules` just to collect CSS imports for the server style manifest and we can filter out unused modules there. ## 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) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> |
||
---|---|---|
.. | ||
config | ||
loaders | ||
plugins | ||
require-hook.ts | ||
stringify-request.ts |