Skip to content

Commit

Permalink
fix(vite-node): init the debugger ahead of time to ensure that load d…
Browse files Browse the repository at this point in the history
…umped code work as expected (fix #2126) (#2127)
  • Loading branch information
await-ovo committed Oct 14, 2022
1 parent b2c332e commit d0c0998
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vite-node/src/server.ts
Expand Up @@ -5,7 +5,7 @@ import createDebug from 'debug'
import type { DebuggerOptions, FetchResult, RawSourceMap, ViteNodeResolveId, ViteNodeServerOptions } from './types'
import { shouldExternalize } from './externalize'
import { toArray, toFilePath, withInlineSourcemap } from './utils'
import type { Debugger } from './debug'
import { Debugger } from './debug'

export * from './externalize'

Expand Down Expand Up @@ -59,7 +59,7 @@ export class ViteNodeServer {
}, options.debug ?? {})
}
if (options.debug)
import('./debug').then(r => this.debugger = new r.Debugger(server.config.root, options.debug!))
this.debugger = new Debugger(server.config.root, options.debug!)
}

shouldExternalize(id: string) {
Expand Down

0 comments on commit d0c0998

Please sign in to comment.