From 83680c065a106a0e88220e55202fe27728032093 Mon Sep 17 00:00:00 2001 From: Martin Sonnberger Date: Fri, 13 Nov 2026 14:00:03 +0100 Subject: [PATCH] build(browser): Inline all constants in CDN bundles Rolldown's default `inlineConst: 'smart'` only inlines constants in conditions, so frequently used `@sentry/conventions` strings end up both as a variable and as literal copies. Inlining everywhere grows the raw output but shrinks the gzipped CDN bundles by ~90-170 B each. Co-Authored-By: Claude Opus 5.5 --- dev-packages/rollup-utils/bundleHelpers.mjs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dev-packages/rollup-utils/bundleHelpers.mjs b/dev-packages/rollup-utils/bundleHelpers.mjs index 04a6a8a68f77..b77ff979da87 100644 --- a/dev-packages/rollup-utils/bundleHelpers.mjs +++ b/dev-packages/rollup-utils/bundleHelpers.mjs @@ -123,6 +123,12 @@ export function makeBaseBundleConfig(options) { }, plugins: [productionReplacePlugin], treeshake: treeShakePreset('smallest'), + optimization: { + // The default `'smart'` mode inlines constants only in conditions, leaving both a variable and + // literal copies of the same string. Inlining everywhere grows the raw output but shrinks it + // after gzip, since repeated literals compress better than variable references. + inlineConst: { mode: 'all' }, + }, }; const bundleTypeConfigMap = {