🧼 optimize install size#35
Open
natemoo-re wants to merge 14 commits into
Open
Conversation
commit: |
dreyfus92
approved these changes
May 23, 2026
Member
dreyfus92
left a comment
There was a problem hiding this comment.
overall looks really good. since you're optimizing install size, are you planning on the near future to add a "no size regression test", cause rn there's nothing in the CI that asserts the package stays under a certain size. without that the size could quietly creep back up over time.
ghostdevv
suggested changes
May 23, 2026
natemoo-re
added a commit
that referenced
this pull request
May 24, 2026
Co-Authored-By: ghostdevv <ghostdevbusiness@gmail.com>
natemoo-re
added a commit
that referenced
this pull request
May 24, 2026
- replace sourceMap/declarationMap/target compiler options with skipSourceOutput: true - add type: "module" to package config - remove redundant files: ["esm"] (npm excludes lock files automatically, .npmignore handles the rest) Co-Authored-By: ghostdevv <ghostdevbusiness@gmail.com>
Co-Authored-By: ghostdevv <47755378+ghostdevv@users.noreply.github.com>
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.
Reduces npm install size by 86% (832 kB → 113 kB unpacked) via:
optimizing clang build flags with explicit exports and dead code elimination
running wasm-opt on the generated wasm output
deflate-compressed base64brotli-11 compressed z85wasm.tsfile (decodes and passes throughDecompressionStreambefore instantiating)wasm.tsfile (decodes vianode:zlibbefore instantiating)stripped source maps and
src/duplication from the npm packagetwo rewrite passes on the
wcwidthtableloandcounttables with compact 4-byte encodings whereuint16_t count = hi - loAlso bumps minimum node version to v22 (current LTS).