Skip to content

build: keep minify with readable output (strip comments, keep whitespace)#552

Merged
jerome-benoit merged 3 commits into
mainfrom
build/readable-minify
May 10, 2026
Merged

build: keep minify with readable output (strip comments, keep whitespace)#552
jerome-benoit merged 3 commits into
mainfrom
build/readable-minify

Conversation

@jerome-benoit

Copy link
Copy Markdown
Collaborator

Closes #547

Summary

Keep minification (compress + mangle) for optimal file size, but make the output readable for debugging:

  • Strip comments (outputOptions.comments: false) — redundant with .d.ts JSDoc
  • Keep whitespace (codegen.removeWhitespace: false) — code stays human-readable

Result: 38 kB (vs 32 kB fully minified, vs 46 kB unminified). Best trade-off between size and debuggability as suggested in #547.

@jerome-benoit jerome-benoit requested a review from Uzlopak as a code owner May 10, 2026 23:13
Copilot AI review requested due to automatic review settings May 10, 2026 23:13
@pkg-pr-new

pkg-pr-new Bot commented May 10, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/tinybench@552

commit: a9df46c

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts the tsdown build configuration to keep the published JS output relatively small while improving debuggability by preserving formatting.

Changes:

  • Configure minification to keep whitespace (minify.codegen.removeWhitespace: false) while still compressing and mangling.
  • Strip comments from generated output via outputOptions.comments: false.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tsdown.config.ts Outdated
Comment on lines +6 to +8
// eslint-disable-next-line @cspell/spellchecker
codegen: {
removeWhitespace: false,
Copilot AI review requested due to automatic review settings May 10, 2026 23:22
@github-actions

Copy link
Copy Markdown

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
dist/index.js 10.13 KB (-0.03% 🔽) 203 ms (-0.03% 🔽) 13 ms (-9.57% 🔽) 216 ms

@jerome-benoit jerome-benoit merged commit fe0a6f9 into main May 10, 2026
27 checks passed
@jerome-benoit jerome-benoit deleted the build/readable-minify branch May 10, 2026 23:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

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