File tree Expand file tree Collapse file tree
packages/vite/src/node/plugins Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ import {
4343 normalizePath ,
4444 prettifyUrl ,
4545 removeImportQuery ,
46+ removeTimestampQuery ,
4647 stripBase ,
4748 stripBomTag ,
4849 timeFrom ,
@@ -685,7 +686,9 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
685686 // `importedUrls` will be mixed with watched files for the module graph,
686687 // `staticImportedUrls` will only contain the static top-level imports and
687688 // dynamic imports
688- const staticImportedUrls = new Set ( _orderedImportedUrls )
689+ const staticImportedUrls = new Set (
690+ _orderedImportedUrls . map ( ( url ) => removeTimestampQuery ( url ) ) ,
691+ )
689692 const acceptedUrls = mergeAcceptedUrls ( orderedAcceptedUrls )
690693 const acceptedExports = mergeAcceptedUrls ( orderedAcceptedExports )
691694
Original file line number Diff line number Diff line change @@ -186,6 +186,17 @@ if (!isBuild) {
186186 ( ) => el . textContent ( ) ,
187187 'soft-invalidation/index.js is transformed 1 times. child is updated' ,
188188 )
189+
190+ editFile ( 'soft-invalidation/index.js' , ( code ) =>
191+ code . replace ( 'child is' , 'child is now' ) ,
192+ )
193+ editFile ( 'soft-invalidation/child.js' , ( code ) =>
194+ code . replace ( 'updated' , 'updated?' ) ,
195+ )
196+ await untilUpdated (
197+ ( ) => el . textContent ( ) ,
198+ 'soft-invalidation/index.js is transformed 2 times. child is now updated?' ,
199+ )
189200 } )
190201
191202 test ( 'plugin hmr handler + custom event' , async ( ) => {
You can’t perform that action at this time.
0 commit comments