oddbird / css-anchor-positioning

Polyfill for CSS Anchor Positioning
https://anchor-positioning.oddbird.net
BSD 3-Clause "New" or "Revised" License
274 stars 10 forks source link

Audit polyfill size #276

Closed jamesnw closed 3 days ago

jamesnw commented 4 days ago

It would be useful to audit the polyfill dist size, with a tool like rollup-plugin-bundle-stats. The majority of the code is from csstree, and we may be able to reduce the size by changing how we import things.

jamesnw commented 4 days ago

Current state:

image

Bundle Size: 223.72KiB

Moving from import * as csstree to more granular imports-

image

Bundle Size: 116.87KiB

We might be able to reduce by another 41kb by removing source-map-js- I suspect it is not needed in the compiled bundle.