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

Function getBrowserFileSourceMap

packages/browser/src/node/rpc.ts:278–288  ·  view source on GitHub ↗
(id)

Source from the content-addressed store, hash-verified

276 await fs.unlink(id)
277 },
278 getBrowserFileSourceMap(id) {
279 const mod = globalServer.vite.moduleGraph.getModuleById(id)
280 const result = mod?.transformResult
281 // handle non-inline source map such as pre-bundled deps in node_modules/.vite
282 if (result && !result.map) {
283 const filePath = id.split('?')[0]
284 const extracted = extractSourcemapFromFile(result.code, filePath)
285 return extracted?.map
286 }
287 return result?.map
288 },
289 cancelCurrentRun(reason) {
290 vitest.cancelCurrentRun(reason)
291 },

Callers

nothing calls this directly

Calls 1

extractSourcemapFromFileFunction · 0.90

Tested by

no test coverage detected