-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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(css): remove ?direct
in id for postcss process
#10514
Conversation
describe('css path resolutions', () => { | ||
const mockedProjectPath = path.join(process.cwd(), '/foo/bar/project') | ||
const mockedBarCssRelativePath = '/css/bar.module.css' | ||
const mockedFooCssRelativePath = '/css/foo.module.css' | ||
|
||
test('cssmodule compose/from path resolutions', async () => { |
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.
reviewer note: There's a lot of change in this test file. The gist of what I did is that I extracted the CSS plugin transform setup for this old test so that I can reuse it for the newly added test.
Whadaya know we indeed have test to prevent the breaking change 😄 |
Wait I was the one who approve #7827 too 🙈 Was thinking of just removing the |
Yeah, I think we could remove |
?direct
in id for postcss process
Co-authored-by: patak <[email protected]>
Description
Fix #5097
If a CSS module is loaded via client and server, the
id
may differ in?direct
due to import/fetch limitations.A custom
generateScopedName
may be used that derives from the file name, but because of?direct
, it generates a different hash even if the content is the same.This PR cleans the id before passing to postcss.
Additional context
I'm not sure if there are postcss plugins out there that rely on the query params to do something special, but that sounds hacky in the first place 🤔 And if so, this PR would break those usecase.
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).