Skip to content

Commit

Permalink
perf(resolve): skip for virtual files (#12638)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBarre committed Mar 29, 2023
1 parent 9697e64 commit 9e13f5f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/vite/src/node/plugins/resolve.ts
Expand Up @@ -142,6 +142,15 @@ export function resolvePlugin(resolveOptions: InternalResolveOptions): Plugin {
name: 'vite:resolve',

async resolveId(id, importer, resolveOpts) {
if (
id[0] === '\0' ||
id.startsWith('virtual:') ||
// When injected directly in html/client code
id.startsWith('/virtual:')
) {
return
}

const ssr = resolveOpts?.ssr === true

// We need to delay depsOptimizer until here instead of passing it as an option
Expand Down

0 comments on commit 9e13f5f

Please sign in to comment.