Skip to content

Commit 413d568

Browse files
authored
🐛 fix bundle size increase threshold never triggering (#4852)
1 parent 3973ac3 commit 413d568

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/bundle-size/lib/bundleSizes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { fetchPerformanceMetrics } from './fetchPerformanceMetrics.ts'
66
import { markdownArray, type Pr } from './reportAsAPrComment.ts'
77

88
// The value is set to 5% as it's around 10 times the average value for small PRs.
9-
const SIZE_INCREASE_THRESHOLD = 5
9+
const SIZE_INCREASE_THRESHOLD = 0.05
1010

1111
export async function computeAndReportBundleSizes(pr?: Pr) {
1212
const localBundleSizes = extractUncompressedBundleSizes(calculateBundleSizes())
@@ -84,7 +84,7 @@ export function formatBundleSizes({
8484
})
8585

8686
if (highIncreaseDetected) {
87-
message += `\n⚠️ The increase is particularly high and exceeds ${SIZE_INCREASE_THRESHOLD}%. Please check the changes.`
87+
message += `\n⚠️ The increase is particularly high and exceeds ${formatPercentage(SIZE_INCREASE_THRESHOLD)}. Please check the changes.`
8888
}
8989

9090
return message

0 commit comments

Comments
 (0)