diff --git a/packages/rolldown/src/app/components/compare/DeltaValue.vue b/packages/rolldown/src/app/components/compare/DeltaValue.vue index aa5a07709..1389fac8e 100644 --- a/packages/rolldown/src/app/components/compare/DeltaValue.vue +++ b/packages/rolldown/src/app/components/compare/DeltaValue.vue @@ -3,7 +3,7 @@ import { bytesToHumanSize } from '@vitejs/devtools-ui/utils/format' import { computed } from 'vue' const props = withDefaults(defineProps<{ - value: number + value: number | null format?: 'bytes' | 'duration' | 'number' signed?: boolean }>(), { @@ -12,18 +12,21 @@ const props = withDefaults(defineProps<{ }) const sign = computed(() => { - if (!props.signed || props.value === 0) + if (!props.signed || props.value == null || props.value === 0) return '' return props.value > 0 ? '+' : '-' }) const colorClass = computed(() => { - if (!props.signed || props.value === 0) + if (!props.signed || props.value == null || props.value === 0) return 'text-gray-500' return props.value > 0 ? 'text-red-500' : 'text-green-500' }) const formatted = computed(() => { + if (props.value == null) + return { amount: 'Unavailable', unit: '' } + const value = props.signed ? Math.abs(props.value) : props.value if (props.format === 'bytes') { diff --git a/packages/rolldown/src/app/components/compare/SessionMeta.vue b/packages/rolldown/src/app/components/compare/SessionMeta.vue index 45d449187..688e99150 100644 --- a/packages/rolldown/src/app/components/compare/SessionMeta.vue +++ b/packages/rolldown/src/app/components/compare/SessionMeta.vue @@ -1,5 +1,6 @@ @@ -712,7 +725,7 @@ function sumDelta(rows: SplitDiffRow[]) { -
+
-