__vite__injectQuery() — vite Function Reference
Architecture documentation for the __vite__injectQuery() function in importAnalysis.ts from the vite codebase.
Entity Profile
Dependency Diagram
graph TD 5c502cbd_0270_1ad8_296b_fcda547aed69["__vite__injectQuery()"] 5a7b98e4_4eb1_dfca_508b_2d43e2a077e6["importAnalysis.ts"] 5c502cbd_0270_1ad8_296b_fcda547aed69 -->|defined in| 5a7b98e4_4eb1_dfca_508b_2d43e2a077e6 style 5c502cbd_0270_1ad8_296b_fcda547aed69 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/vite/src/node/plugins/importAnalysis.ts lines 1119–1132
function __vite__injectQuery(url: string, queryToInject: string): string {
// skip urls that won't be handled by vite
if (url[0] !== '.' && url[0] !== '/') {
return url
}
// can't use pathname from URL since it may be relative like ../
const pathname = url.replace(/[?#].*$/, '')
const { search, hash } = new URL(url, 'http://vite.dev')
return `${pathname}?${queryToInject}${search ? `&` + search.slice(1) : ''}${
hash || ''
}`
}
Domain
Subdomains
Source
Frequently Asked Questions
What does __vite__injectQuery() do?
__vite__injectQuery() is a function in the vite codebase, defined in packages/vite/src/node/plugins/importAnalysis.ts.
Where is __vite__injectQuery() defined?
__vite__injectQuery() is defined in packages/vite/src/node/plugins/importAnalysis.ts at line 1119.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free