Skip to content

Commit cb67fbc

Browse files
IWANABETHATGUYsapphi-red
authored andcommitted
feat: 🎸 add an new option to disable build report
1 parent c6dbda3 commit cb67fbc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎packages/vite/src/node/build.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ export interface BuildEnvironmentOptions {
273273
name: string,
274274
config: ResolvedConfig,
275275
) => Promise<BuildEnvironment> | BuildEnvironment
276+
enableBuildReport?: boolean
276277
}
277278

278279
export type BuildOptions = BuildEnvironmentOptions
@@ -385,6 +386,7 @@ export function resolveBuildEnvironmentOptions(
385386
emitAssets: consumer === 'client',
386387
reportCompressedSize: true,
387388
chunkSizeWarningLimit: 500,
389+
enableBuildReport: true,
388390
// watch: null,
389391
createEnvironment: (name, config) => new BuildEnvironment(name, config),
390392
}
@@ -463,6 +465,7 @@ export async function resolveBuildPlugins(config: ResolvedConfig): Promise<{
463465
post: RolldownPlugin[]
464466
}> {
465467
const enableNativePlugin = config.experimental.enableNativePlugin
468+
const enableBuildReport = config.build.enableBuildReport
466469
// TODO: support commonjs options?
467470
return {
468471
pre: [
@@ -497,7 +500,7 @@ export async function resolveBuildPlugins(config: ResolvedConfig): Promise<{
497500
nativeManifestPlugin()
498501
: manifestPlugin(),
499502
ssrManifestPlugin(),
500-
buildReporterPlugin(config),
503+
...(enableBuildReport ? [buildReporterPlugin(config)] : []),
501504
]
502505
: []),
503506
enableNativePlugin

0 commit comments

Comments
 (0)