build: migrate bundling from rollup+tsc to tsdown#58
Open
alexvictoor wants to merge 1 commit into
Open
Conversation
Replace the two-tool build (tsc for per-file CJS + Rollup for the UMD bundle) with a single tsdown (Rolldown + Oxc) config. Benchmarked against rollup, esbuild and tsup on this repo: tsdown builds ~2.3x faster than the old tsc+rollup step while emitting ESM + CJS + UMD + bundled .d.ts from one command, with equivalent output size. - Add tsdown.config.ts: unbundled ESM/CJS (per-module, so consumers can tree-shake unused histogram types and the ~33kB inlined WASM blob) plus a bundled UMD build kept at dist/hdrhistogram.umd.js for CDN back-compat. - package.json: add "module", a proper "exports" map (import/require + types), "sideEffects": false, and prepublishOnly. Fix "files" to ["dist"] (was ["."], which published the whole repo root). Drop rollup, the four @rollup/* plugins and the dead ts-loader; add tsdown. - Delete rollup.config.js. - README: rewrite the Tree Shaking section for the new tree-shakeable named imports and document the v3->v4 packaging change. - Docs: fix engines.node in the v3->v4 migration notes (>=22, matching package.json and CI); "Node 18+" is kept only as the Compression Streams API availability baseline.
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.
Replace the two-tool build (tsc for per-file CJS + Rollup for the UMD bundle) with a single tsdown (Rolldown + Oxc) config. Benchmarked against rollup, esbuild and tsup on this repo: tsdown builds ~2.3x faster than the old tsc+rollup step while emitting ESM + CJS + UMD + bundled .d.ts from one command, with equivalent output size.