diff --git a/packages/next/build/webpack-config.ts b/packages/next/build/webpack-config.ts index b0fb1a7cc9be..9175e099e3a8 100644 --- a/packages/next/build/webpack-config.ts +++ b/packages/next/build/webpack-config.ts @@ -1310,7 +1310,7 @@ export default async function getBaseWebpackConfig( new BuildStatsPlugin({ distDir, }), - new ProfilingPlugin({ runWebpackSpan }), + process.env.TRACE_TARGET && new ProfilingPlugin({ runWebpackSpan }), config.optimizeFonts && !dev && isServer &&