File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -510,6 +510,7 @@ function createResolver(
510510
511511 const hashQueryPattern = / [ # ? ] .+ $ /
512512 const queryPattern = / \? .+ $ /
513+ const dtsPattern = / \. d \. t s ( \? | $ ) /
513514
514515 return async ( viteResolve , id , importer ) => {
515516 // Remove query and hash parameters from the importer path.
@@ -551,6 +552,13 @@ function createResolver(
551552 resolutionCache . set ( id , resolvedId )
552553 }
553554
555+ // If we get a .d.ts file (ambient type declarations), it's because a
556+ // tsconfig file is being used for opt-in type overrides. This is an
557+ // unusual pattern, but we can just stop here to avoid trouble.
558+ if ( dtsPattern . test ( resolvedId ) ) {
559+ return notApplicable
560+ }
561+
554562 // Restore the query if one was removed earlier.
555563 if ( query ) {
556564 resolvedId += query
You can’t perform that action at this time.
0 commit comments