-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
feat(resolve)!: allow removing conditions #18395
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
Merged
patak-dev
merged 22 commits into
vitejs:main
from
sapphi-red:feat/allow-removing-conditions
Oct 31, 2024
Merged
Changes from 15 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
713cee3
feat(resolve)!: allow removing conditions
sapphi-red 15f4875
chore: remove unrelated diff
sapphi-red 5492d2f
chore: merge main
sapphi-red c8ab916
chore: try set default value first
sapphi-red 7ebc958
chore: don't use local vite for vitest for now
sapphi-red 2f833c7
Revert "chore: don't use local vite for vitest for now"
sapphi-red c3bf6d8
chore: try patch vitest
sapphi-red 33c89e2
chore: merge main
sapphi-red 0cb8863
Revert "chore: try patch vitest"
sapphi-red ff6a3d8
Revert "chore: try set default value first"
sapphi-red edcf8f3
refactor: remove `webCompatible`
sapphi-red d7f60c8
chore: merge main
sapphi-red 1a4121c
docs: update
sapphi-red 41bfab4
test: don't add node to conditions
sapphi-red 405f65a
docs: add migration guide
sapphi-red 980ac56
feat!: don't inherit `resolve.conditions` and `resolve.mainFields` fo…
sapphi-red 4985011
feat: introduce `DEV_PROD_CONDITION` variable
sapphi-red 0ced80a
chore: merge main
sapphi-red 92c2658
fix: remove DEV_PROD_CONDITION from `fetchModule`
sapphi-red 68ff9fb
fix: log.inspectOpts seems to be undefined?
sapphi-red a40eb20
refactor: replace DEV_PROD_CONDITION with `development|production`
sapphi-red c6a234a
chore: wording
patak-dev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
packages/vite/src/node/__tests__/fixtures/test-dep-conditions/index.custom2.js
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
packages/vite/src/node/__tests__/fixtures/test-dep-conditions/index.custom3.js
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What is a good use case for not passing
productionanddevelopment?I'm wondering if we should treat these two specially, like you do with
import,require,default. Given that they are the only ones that are conditionally applied, it feels cleaner forresolve.conditionsto be "the conditions that are always applied". We could add a way to pass a function for each condition to specifythe conditions for example if we want to explicitly define them, or ask for
['module', 'browser', 'node', process.env.NODE_ENV], maybe this should be the default if we keep it in the conditions?)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.
As we discussed in the team meeting, I introduced
DEV_PROD_CONDITIONvariable that will be replaced withproductionordevelopment: 4985011