refactor!: plugin container API options#5294
Merged
Conversation
Shinigami92
approved these changes
Oct 14, 2021
haoqunjiang
approved these changes
Oct 22, 2021
bluwy
approved these changes
Oct 22, 2021
Member
Author
|
I didn't find a single use case of this API in the ecosystem. So it looks that this PR is safe to merge. |
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.
Description
This refactor is a complement to #5253
Vite exposes in the JS API through the server, access to the
pluginContainerso users can externally callresolveId,transform, andload.We have discussed this change with most players in the ecosystem and looks like no one is using this API. VitePress, SvelteKit, Astro, vite-plugin-ssr, vite-edge, are on board. So I think that even if this is a breaking change, we can include it in the next minor. These functions are not documented. The only reference is that the
pluginContaineris public here https://vitejs.dev/guide/api-javascript.html#vitedevserver.The current interface is
This PR aligns the API with the plugin hooks, so we are able to introduce or deprecate options without breaking changes in the future. I left the names as they currently were in the API.
What is the purpose of this pull request?