refactor: optimise dependencies#14951
Merged
ematipico merged 8 commits intofeat/environment-apifrom Dec 4, 2025
Merged
Conversation
|
Contributor
|
Pulled this down locally and confirmed that uncached the |
matthewp
reviewed
Dec 3, 2025
matthewp
approved these changes
Dec 3, 2025
Contributor
|
Approved once tests are passing again. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changes
This PR reworks how dependencies are optimised and resolved by using the new hook
configEnvironmentfromvitev7.Astro core
As for
createVite, I decided to move the resolution inside a plugin, so it doesn't clutter the already bigcraeteVitefunction. I tried to keep the same logic we had before.Cloudflare
I removed stuff that I think it's not needed anymore. All current tests work and the fixture builds without issues. The preview server still works as expected.
I had to add an exception for the unstorage driver because it couldn't be optimised, and the server was crashing.
Other integrations
I updated other integrations such as
react,vue,solid,svelteandpreact.As for
vue, I had to addvue/server-rendererbecause it was crashing the Cloudflare server.Note
I plan to optimise the rest of the integrations in another PR
Testing
After this change, one of the tests in cloudflare broke. The thing is, I had to change the test assumptions earlier, but now the build output is back to how it was, so I restored the test's previous assertion.
The remaining tests should work.
Docs
N/A