Skip to content

Commit

Permalink
feat: expose ssrRewriteStacktrace
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Feb 25, 2022
1 parent 67d1643 commit 941f139
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 @@ -226,7 +226,11 @@ export interface ViteDevServer {
*/
ssrLoadModule(url: string): 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 @@ -376,6 +380,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 941f139

Please sign in to comment.