forked from vitejs/vite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit improves the parity of behaviour between 'vite build' and 'vite dev' when Rollup plugins retuning non-null 'meta' properties from resolveId() hooks are used. If one takes the Rollup behaviour to be any kind of reference in these cases, this is fixing a small bug in Vite, which was in a very large part already fixed by PR vitejs#5465. Here's an explanation of the faulty behaviour: The normalizeUrl() helper calls user plugins's resolveId() twice. - Once with the URL string containing a query suffix. Here it _ignores_ the meta reply. - Again, with the URL no longer containing said suffix. Here it doesn't ignore the meta reply. It is stored in the moduleGraph node. As can be seen, if the user's plugin meta reply depends on the query suffix being passed in the imported URL, that meta reply won't be registered correctly in the module graph and is not retrievable via getModuleInfo() later on. This change makes it so that the first call doesn't ignore the meta reply. This makes Vite's dev server match Rollup's plugin-calling behaviour. Fixes vitejs#6766
- Loading branch information
1 parent
f148c18
commit a82ef99
Showing
3 changed files
with
85 additions
and
17 deletions.
There are no files selected for viewing
This file contains 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 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 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