rsnext/packages
Shu Ding 8b44085b70
Fix CSS not being bundled in app dir (#45787)
Currently all import CSS resources, including CSS modules, are imported lazily. This means that they can't be chunked as by definition of "lazy" they can be loaded separately.

This PR changes it to always use "eager" so if they're in the same entry, these CSS resources can be chunked together and reduce the total amount of requests. However the downside will be tree shaking, as not all modules in a chunk are used by one entry. Two entries can only share a part of it.

Since CSS modules won't have side effects this should be a good trade off.

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/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`
- [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) 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`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && 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: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2023-03-17 17:38:19 +00:00
..
create-next-app v13.2.5-canary.7 2023-03-17 13:31:21 +01:00
eslint-config-next v13.2.5-canary.7 2023-03-17 13:31:21 +01:00
eslint-plugin-next v13.2.5-canary.7 2023-03-17 13:31:21 +01:00
font v13.2.5-canary.7 2023-03-17 13:31:21 +01:00
next Fix CSS not being bundled in app dir (#45787) 2023-03-17 17:38:19 +00:00
next-bundle-analyzer v13.2.5-canary.7 2023-03-17 13:31:21 +01:00
next-codemod v13.2.5-canary.7 2023-03-17 13:31:21 +01:00
next-env v13.2.5-canary.7 2023-03-17 13:31:21 +01:00
next-mdx v13.2.5-canary.7 2023-03-17 13:31:21 +01:00
next-plugin-storybook v13.2.5-canary.7 2023-03-17 13:31:21 +01:00
next-polyfill-module v13.2.5-canary.7 2023-03-17 13:31:21 +01:00
next-polyfill-nomodule v13.2.5-canary.7 2023-03-17 13:31:21 +01:00
next-swc v13.2.5-canary.7 2023-03-17 13:31:21 +01:00
react-dev-overlay v13.2.5-canary.7 2023-03-17 13:31:21 +01:00
react-refresh-utils v13.2.5-canary.7 2023-03-17 13:31:21 +01:00