(
url,
importer,
environmentName,
options,
otelCarrier,
)
| 28 | project.vitest.state.metadata[project.name].dumpDir = project.config.dumpDir |
| 29 | return { |
| 30 | async fetch( |
| 31 | url, |
| 32 | importer, |
| 33 | environmentName, |
| 34 | options, |
| 35 | otelCarrier, |
| 36 | ) { |
| 37 | const environment = project.vite.environments[environmentName] |
| 38 | if (!environment) { |
| 39 | throw new Error(`The environment ${environmentName} was not defined in the Vite config.`) |
| 40 | } |
| 41 | |
| 42 | const start = performance.now() |
| 43 | |
| 44 | return await project._fetcher(url, importer, environment, cacheFs, options, otelCarrier).then((result) => { |
| 45 | const duration = performance.now() - start |
| 46 | project.vitest.state.transformTime += duration |
| 47 | const metadata = project.vitest.state.metadata[project.name] |
| 48 | if ('externalize' in result) { |
| 49 | metadata.externalized[url] = result.externalize |
| 50 | } |
| 51 | if ('tmp' in result) { |
| 52 | metadata.tmps[url] = result.tmp |
| 53 | } |
| 54 | metadata.duration[url] ??= [] |
| 55 | metadata.duration[url].push(duration) |
| 56 | return result |
| 57 | }) |
| 58 | }, |
| 59 | async resolve(id, importer, environmentName) { |
| 60 | const environment = project.vite.environments[environmentName] |
| 61 | if (!environment) { |
no outgoing calls