Skip to content
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

[pigment-css][nextjs-plugin] Fix alias resolver #41494

Merged
merged 1 commit into from Mar 15, 2024

Conversation

brijeshb42
Copy link
Contributor

Uses webpack's internal resolver to resolve aliased paths during WyW's evaluation phase.

This allows WyW to resolve aliased paths (through tsconfig) in Next.js to their actual paths.

Closes #41482

@brijeshb42 brijeshb42 added nextjs package: pigment-css Specific to @pigment-css/* labels Mar 14, 2024
@brijeshb42 brijeshb42 requested a review from a team March 14, 2024 13:24
@mui-bot
Copy link

mui-bot commented Mar 14, 2024

Netlify deploy preview

https://deploy-preview-41494--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 8a8e9ce

@brijeshb42 brijeshb42 force-pushed the pigment/next-resolve branch 2 times, most recently from 114daab to 1750e44 Compare March 14, 2024 13:44
@brijeshb42 brijeshb42 requested review from siriwatknp and removed request for a team March 14, 2024 15:21
Uses webpack's internal resolver to resolve aliased paths during WyW's
evaluation phase.
return result;
}
// Use Webpack's resolver to resolve actual path but
// ignore next.js files during evaluation phase of WyW
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to this PR but it seems like we can ignore the emotion as well for the .toString error, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me check if it fixes emotion related issue but I am sure these two are unrelated. Maybe we can point that emotion import to a dummy file similar to what we do for next/image/next/font.

Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Tested, it works!

@brijeshb42 brijeshb42 merged commit 2e7bb84 into mui:master Mar 15, 2024
19 checks passed
@brijeshb42 brijeshb42 deleted the pigment/next-resolve branch March 15, 2024 06:52
brijeshb42 added a commit to brijeshb42/material-ui that referenced this pull request Mar 15, 2024
Resolve React and other related libraries to the actual ones in
node_modules instead of Next.js' own version of React that will also
include RSC related code that is not actually needed during WyW eval.
brijeshb42 added a commit to brijeshb42/material-ui that referenced this pull request Mar 15, 2024
Resolve React and other related libraries to the actual ones in
node_modules instead of Next.js' own version of React that will also
include RSC related code that is not actually needed during WyW eval.
brijeshb42 added a commit to brijeshb42/material-ui that referenced this pull request Mar 15, 2024
Resolve React and other related libraries to the actual ones in
node_modules instead of Next.js' own version of React that will also
include RSC related code that is not actually needed during WyW eval.
brijeshb42 added a commit that referenced this pull request Mar 15, 2024
Signed-off-by: Brijesh Bittu <brijeshb42@gmail.com>
Co-authored-by: Siriwat K <siriwatkunaporn@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nextjs package: pigment-css Specific to @pigment-css/*
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[pigment-css] Support module aliases in nextjs-plugin
3 participants