Skip to content

Improve package output for tree shaking - #293

Open
krowvin wants to merge 4 commits into
mainfrom
tree-shaking-improvements
Open

Improve package output for tree shaking#293
krowvin wants to merge 4 commits into
mainfrom
tree-shaking-improvements

Conversation

@krowvin

@krowvin krowvin commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Improves the library package output so consumers can import smaller parts of Groundwork without pulling the whole bundle:

  • publish preserved ESM modules alongside the existing UMD build
  • expose component, composite, hook, and utility subpaths
  • move CSS to an explicit stylesheet entry
  • lazy-load heavier footer image assets

Bundle check

Package pack size:

Package Before After
Packed tarball 4.65 MB 4.55 MB
Unpacked package 7.45 MB 7.05 MB

Representative downstream production bundle using Button from the package root:

Import Before Current Gzip before Gzip current
Button from @usace/groundwork 368.9 KB 240.2 KB 115.1 KB 75.1 KB

Validation

  • clean npm ci
  • npm test -- --run (2 files, 8 tests)
  • npm run lint
  • npm run build-lib
  • npm run build
  • npm pack and verified the expected ESM modules, UMD bundle, and explicit CSS entry
  • installed the packed tarball in a clean React 19/Vite 8 consumer and completed a production build with zero vulnerabilities

The library and docs assets build successfully. The existing post-build route extraction still reports the missing direct @babel/parser development dependency, which is addressed separately by #300.

Related: #191, #218, #221, #179

@github-actions

Copy link
Copy Markdown

Please set a versioning label of either major-bump, minor-bump, or patch-bump to the pull request.

@krowvin
krowvin marked this pull request as ready for review August 26, 2026 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant