diff --git a/packages/webpack/lib/plugins/log.js b/packages/webpack/lib/plugins/log.js index ba24325c70..0a0579bcd3 100644 --- a/packages/webpack/lib/plugins/log.js +++ b/packages/webpack/lib/plugins/log.js @@ -46,9 +46,11 @@ const formatWarning = (name, duration, assets, isRebuild) => { }; const formatSuccess = (name, duration, assets, isRebuild) => { - const totalSize = Object.values(assets).reduce((sum, asset) => { - return sum + (asset.name.endsWith('.map') ? 0 : asset.size); - }, 0); + const totalSize = Object.values(assets) + .filter((asset) => !asset.name.endsWith('.map')) + .reduce((sum, asset) => { + return sum + asset.size; + }, 0); const message = `bundling '${name}' finished after ${duration} (${prettyBytes( totalSize )})`;