nbd-wtf / js-lnurl

tools for adding lnurl support in a wallet
MIT License
30 stars 7 forks source link

Split helpers up to reduce bundle size #8

Closed wbobeirne closed 1 year ago

wbobeirne commented 1 year ago

Closes #5.

wbobeirne commented 1 year ago

Using a default nextjs project, here's the savings in size:

Default NextJS (No js-lnurl)

Route (pages)                              Size     First Load JS
┌ ○ /                                      4.5 kB         78.4 kB
├   └ css/32586a8b0a8a958d.css             1.73 kB
├   /_app                                  0 B            73.9 kB

NextJS with current js-lnurl

  Route (pages)                              Size     First Load JS
┌ ○ /                                      37.6 kB         112 kB
├   └ css/32586a8b0a8a958d.css             1.73 kB
├   /_app                                  0 B            73.9 kB

NextJS with this PR's js-lnurl

  Route (pages)                              Size     First Load JS
┌ ○ /                                      18.9 kB        92.8 kB
├   └ css/32586a8b0a8a958d.css             1.73 kB
├   /_app                                  0 B            73.9 kB