-
Notifications
You must be signed in to change notification settings - Fork 162
feat: add css files to server bundle for optimizeCss feature to work #904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add css files to server bundle for optimizeCss feature to work #904
Conversation
🦋 Changeset detectedLatest commit: d2d83bc The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
- add css files conditionally depending on optimizeCss flag
- load all manifests and configs in one place once
Hi, team, I added the changes we discussed here, and tested them on our infrastructure, works as expected. Would you be able to take a look once again at this PR? We'll be looking forward to your comments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Could you add a changeset? |
@sommeeeer sure, changeset added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM Thanks
Thank you team for all your reviews and comments! |
Description
The inlining of Critical CSS with the optimizeCss feature doesn't work when using Next.js 15.3.3 (Page Router) and @opennextjs/aws 3.6.5.
The optimizeCss feature relies on the CSS files being present in the server-function bundle. During page rendering (e.g., during ISR or revalidation), a server function using the Critters library attempts to locate the CSS files used on the page and inline them in the HTML. Without these files in the server-function bundle, the inlining process fails.
These changes make the bundling process include
.next/static/css
files in the server-function bundle.Detailed information is in the attached issue below.
GitHub issue
#903