Skip to content

Commit

Permalink
feat: error message add timestamp option
Browse files Browse the repository at this point in the history
  • Loading branch information
btea committed Oct 9, 2023
1 parent dead93f commit c5b4798
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/vite/src/node/plugins/importAnalysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
// Unexpected error, log the issue but avoid an unhandled exception
config.logger.error(`Pre-transform error: ${e.message}`, {
error: e,
timestamp: true,
})
})
}
Expand Down
4 changes: 3 additions & 1 deletion packages/vite/src/node/server/middlewares/indexHtml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,8 @@ function preTransformRequest(server: ViteDevServer, url: string, base: string) {
return
}
// Unexpected error, log the issue but avoid an unhandled exception
server.config.logger.error(`Pre-transform error: ${e.message}`)
server.config.logger.error(`Pre-transform error: ${e.message}`, {
timestamp: true,
})
})
}

0 comments on commit c5b4798

Please sign in to comment.