-
Notifications
You must be signed in to change notification settings - Fork 273
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
fix(nextjs-plugin): properly handles css loader #1105
fix(nextjs-plugin): properly handles css loader #1105
Conversation
🦋 Changeset detectedLatest commit: d1853f5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Thanks for the PR @SukkaW The changes you're making are quite extensive, I don't feel knowledgeable enough about Next to validate it. @SuttonJack @shuding Would really appreciate your thoughts on this? |
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.
Thanks, these look good to me
@mattcompiles Just a friendly ping. Would you like to review my PR? |
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.
@SukkaW Sorry mate. We really appreciate the PR, just struggling with balancing regular life ATM. I honestly don't feel knowledgable enough about Next internals to review this, however I'm comfortable to merge it given the feedback from the others.
Currently the branch is out of date and failing some lint steps in CI which you can run with pnpm lint
. I'll approve and merge as as soon as that's green. Just ping me again once you've pushed it up.
I noticed you talked about version 2.2.0 but the latest version is 2.2.1, which was released an hour ago. Also there is an update to the @vanilla-extract/recipes package. Can you confirm it still exists after updating both packages? |
Closes #1101.
Closes #1131.
Changes:
css-loader
/MiniCssExtractPlugin.loader
instead ofgetClientStyle
from Next.js (which will opt-innext-style-loader
during development mode in the pages directory):next-style-loader
will mess up CSS order which is crucial for vanilla-extractcss-loader
and does not usenext-style-loader
at all anyway.webpack
todevDependencies
loaders
array.peerDependencies.next
to>= 12.1.7
MiniCssExtractPlugin
's HMR fixed.outputCss
logic:app
directory since Next.js App Router needs to collect CSS from React Server Components.pages
directory, output CSS only on the client build.findPagesDir
method to determine if theapp
directory exists.MiniCssExtractPlugin
exists in the webpack config.