MCPcopy
hub / github.com/vitest-dev/vitest / resolveId

Function resolveId

packages/browser/src/node/plugin.ts:295–310  ·  view source on GitHub ↗
(id)

Source from the content-addressed store, hash-verified

293 }
294 },
295 async resolveId(id) {
296 if (!/\?browserv=\w+$/.test(id)) {
297 return
298 }
299
300 let useId = id.slice(0, id.lastIndexOf('?'))
301 if (useId.startsWith('/@fs/')) {
302 useId = useId.slice(5)
303 }
304
305 if (/^\w:/.test(useId)) {
306 useId = useId.replace(/\\/g, '/')
307 }
308
309 return useId
310 },
311 },
312 {
313 name: 'vitest:browser:resolve-virtual',

Callers

nothing calls this directly

Calls 3

resolveFunction · 0.50
testMethod · 0.45
resolveMethod · 0.45

Tested by

no test coverage detected