We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6ce9221 commit 453a60dCopy full SHA for 453a60d
1 file changed
packages/vite/src/index.ts
@@ -223,7 +223,12 @@ function attachMiddleware(server: any, options: ResolvedOptions) {
223
if (options.fileLog.enabled) {
224
const time = new Date().toISOString();
225
const toFile = [`[${time}] ${line}`];
226
- if (entry.stack && options.stackMode !== 'none') toFile.push(indent(entry.stack, ' '));
+ if (entry.stack && options.stackMode !== 'none') {
227
+ const stackLines = options.stackMode === 'full'
228
+ ? indent(entry.stack, ' ')
229
+ : ` ${(String(entry.stack).split(/\r?\n/g).find((l) => l.trim().length > 0) || '').trim()}`;
230
+ toFile.push(stackLines);
231
+ }
232
try { appendFileSync(logFilePath, toFile.join('\n') + '\n'); } catch {}
233
}
234
0 commit comments