Skip to content

Use preserveModules for browser dist to enable proto.js tree-shaking by downstream bundlers#181

Merged
tylerccarson merged 2 commits into
mainfrom
bundle-size-fix
Jun 23, 2026
Merged

Use preserveModules for browser dist to enable proto.js tree-shaking by downstream bundlers#181
tylerccarson merged 2 commits into
mainfrom
bundle-size-fix

Conversation

@tylerccarson

@tylerccarson tylerccarson commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

proto.js is 16.1 MB unminified / 4.81 MiB minified. With a monolithic ES bundle, any keeperapi import pulled in the full file. preserveModules outputs one file per source module so webpack can exclude proto.js entirely from bundles that don't use protobuf (e.g. tabWorker: 4.81 MiB → 40 KB minified, browser action: eliminated as an async chunk). sideEffects lists configureProtobuf so it is never dropped.

…by downstream bundlers

proto.js is 16.1 MB unminified. With a monolithic ES bundle, any keeperapi
import pulled in the full file. preserveModules outputs one file per source
module so webpack can exclude proto.js entirely from bundles that don't use
protobuf (e.g. tabWorker: 16 MB → 42 KB, browser action: eliminated as an
async chunk). sideEffects lists configureProtobuf so it is never dropped.
@datadog-keeper-security

This comment has been minimized.

@tylerccarson tylerccarson merged commit cf3d76a into main Jun 23, 2026
6 checks passed
@tylerccarson tylerccarson deleted the bundle-size-fix branch June 29, 2026 16:28
sgaddala-ks pushed a commit that referenced this pull request Jul 1, 2026
…by downstream bundlers (#181)

proto.js is 16.1 MB unminified. With a monolithic ES bundle, any keeperapi
import pulled in the full file. preserveModules outputs one file per source
module so webpack can exclude proto.js entirely from bundles that don't use
protobuf (e.g. tabWorker: 16 MB → 42 KB, browser action: eliminated as an
async chunk). sideEffects lists configureProtobuf so it is never dropped.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants