MCPcopy
hub / github.com/vitejs/vite / warmupRequest

Method warmupRequest

packages/vite/src/node/server/environment.ts:262–287  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

260 }
261
262 async warmupRequest(url: string): Promise<void> {
263 if (this.bundledDev) {
264 // no-op
265 return
266 }
267
268 try {
269 await transformRequest(this, url, { skipFsCheck: true })
270 } catch (e) {
271 if (
272 e?.code === ERR_OUTDATED_OPTIMIZED_DEP ||
273 e?.code === ERR_CLOSED_SERVER
274 ) {
275 // these are expected errors
276 return
277 }
278 // Unexpected error, log the issue but avoid an unhandled exception
279 this.logger.error(
280 buildErrorMessage(e, [`Pre-transform error: ${e.message}`], false),
281 {
282 error: e,
283 timestamp: true,
284 },
285 )
286 }
287 }
288
289 protected invalidateModule(
290 m: {

Callers

nothing calls this directly

Calls 3

transformRequestFunction · 0.90
buildErrorMessageFunction · 0.90
errorMethod · 0.65

Tested by

no test coverage detected