Skip to content

Commit f32ded5

Browse files
committed
fix: disable chunksReporter at development build
1 parent d1f5305 commit f32ded5

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

packages/vite/src/node/plugins/reporter.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,9 @@ export function buildReporterPlugin(config: ResolvedConfig): Plugin {
292292
: {}),
293293

294294
renderStart() {
295-
chunksReporter(this).reset()
295+
if (config.mode === 'production') {
296+
chunksReporter(this).reset()
297+
}
296298
},
297299

298300
renderChunk(_, chunk, options) {
@@ -326,15 +328,19 @@ export function buildReporterPlugin(config: ResolvedConfig): Plugin {
326328
}
327329
}
328330

329-
chunksReporter(this).register()
331+
if (config.mode === 'production') {
332+
chunksReporter(this).register()
333+
}
330334
},
331335

332336
generateBundle() {
333337
if (shouldLogInfo && tty) clearLine()
334338
},
335339

336340
async writeBundle({ dir }, output) {
337-
await chunksReporter(this).log(output, dir)
341+
if (config.mode === 'production') {
342+
await chunksReporter(this).log(output, dir)
343+
}
338344
},
339345
}
340346
}

0 commit comments

Comments
 (0)