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

Function configureServer

playground/hmr-full-bundle-mode/vite.config.ts:20–31  ·  view source on GitHub ↗
(server)

Source from the content-addressed store, hash-verified

18 name: 'wait-bundle-complete-until-access',
19 apply: 'serve',
20 configureServer(server) {
21 let accessCount = 0
22 resolvers = promiseWithResolvers()
23
24 server.middlewares.use((_req, _res, next) => {
25 accessCount++
26 if (accessCount === 1) {
27 resolvers.resolve()
28 }
29 next()
30 })
31 },
32 async generateBundle() {
33 await resolvers.promise
34 await new Promise<void>((resolve) => setTimeout(resolve, 300))

Callers

nothing calls this directly

Calls 4

nextFunction · 0.85
useMethod · 0.80
promiseWithResolversFunction · 0.70
resolveMethod · 0.65

Tested by

no test coverage detected