build(frontend): strip comments from the production bundle#1572
Merged
Conversation
The @decky/rollup preset ships an unminified ESM bundle and pipes src/ comments verbatim into dist/index.js via @rollup/plugin-typescript, whose removeComments defaults to false. The plugin's dense doc-comments therefore counted against the 800 kB size-limit 1:1 — a budget taxing comment quality, with main sitting at 3.2 kB of headroom. Set removeComments in tsconfig so the TypeScript transpile drops comments from the emitted bundle only. Source is untouched; typecheck (--noEmit) and vitest (own transform) are unaffected. No functional comments exist in src/ (no @license / @preserve / __PURE__ / webpack magic), so nothing load-bearing is lost. Bundle: 799.74 kB -> 512.01 kB.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



The
@decky/rolluppreset ships an unminified ESM bundle and pipessrc/comments verbatim intodist/index.jsvia@rollup/plugin-typescript, whoseremoveCommentsdefaults tofalse. The plugin's dense doc-comments therefore counted against the 800 kBsize-limit1:1 — a budget taxing comment quality.mainsits at ~3.2 kB of headroom, and #1570 has five more PRs queued behind it.Set
removeCommentsintsconfig.jsonso the TypeScript transpile drops comments from the emitted bundle only. Source is untouched;tsc --noEmit(typecheck) and vitest (own transform) are unaffected — only the Rollup build output changes. No functional comments exist insrc/(verified: no@license/@preserve/__PURE__/ webpack magic), so nothing load-bearing is lost.Bundle: 799.74 kB → 512.01 kB — ~290 kB was comment text. Headroom goes from ~260 B to ~288 kB.
mise run gategreen: build, typecheck,pnpm size(512 kB under the 800 kB limit), 2132 frontend + 6260 backend tests, allcheck_*gates.docs: N/A — build tooling only, no user-visible change and no architecture shift.