Skip to content

Commit

Permalink
feat: expose ssrRewriteStacktrace (#7091)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Mar 11, 2022
1 parent dddda1e commit d4ae45d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/vite/src/node/server/index.ts
Expand Up @@ -229,7 +229,11 @@ export interface ViteDevServer {
opts?: { fixStacktrace?: boolean }
): Promise<Record<string, any>>
/**
* Fix ssr error stacktrace
* Returns a fixed version of the given stack
*/
ssrRewriteStacktrace(stack: string): string
/**
* Mutates the given SSR error by rewriting the stacktrace
*/
ssrFixStacktrace(e: Error): void
/**
Expand Down Expand Up @@ -386,6 +390,9 @@ export async function createServer(
rebindErrorStacktrace(e, stacktrace)
}
},
ssrRewriteStacktrace(stack: string) {
return ssrRewriteStacktrace(stack, moduleGraph)
},
listen(port?: number, isRestart?: boolean) {
return startServer(server, port, isRestart)
},
Expand Down

0 comments on commit d4ae45d

Please sign in to comment.