-
-
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: deep resolve side effects when glob does not contain / #11807
fix: deep resolve side effects when glob does not contain / #11807
Conversation
/ecosystem-ci run |
📝 Ran ecosystem CI: Open
|
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 for the PR. We don't currently have tests for sideEffects
AFAICS. I think the proper place would be in the resolve
playground. You can create local packages there to test these using our e2e infra.
We could also move forward and add the tests in another PR so we test this in the wild during the 4.1 beta
If there are no existing tests covering that particular logic, I'm not sure I can add tests for all of it from scratch. Was hoping there were some existing tests so I could only add coverage for the added logic. So perhaps indeed this can move forward as-is for now? The ecosystem CI failures seem to be unrelated to this, right? |
Yes, the three ecosystem-ci are also failing on main and are being worked out with the maintainers of these projects. We discussed this PR with the team today, let's merge it so we get testing during the beta and we can get this one released in 4.1 next week |
Description
This will automatically prefix "simple globs" like
*.css
in sideEffects in package.json to**/*.css
, so such files deep in the module would also be considered as side effects.This is how other bundlers (e.g. webpack, rollup) behave as well, so this is sort of important for cross-bundler compatibility. We ran into this issue, as we updated vite to v4, but had not encountered such issue with any other bundler setup. As an example, here is the very similar code in rollup, the relevant PR and issue.
Additional context
I'd add tests, but did not immediately find any that relate to the loadPackageData function. Can you point me to the appropriate place?
Also, sorry for not filing an issue beforehand, but this change is so small, essentially copy-paste from rollup, so perhaps we can discuss directly in here.
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).