PuruVJ / neoconfetti

Confetti in Svelte
https://www.npmjs.com/package/svelte-confetti-explosion
MIT License
246 stars 9 forks source link

Reduce bundled size #4

Closed andreasmcdermott closed 1 year ago

andreasmcdermott commented 1 year ago

This should have no impact on functionality, only bundle size. Based on my local testing, the current bundle is ~2.32kb min+gzip. With these changes it is ~2.11kb min+gzip. There are a plenty more opportunities for reducing the size, but I didn't want to rename any input parameters/css variables or remove any log messages since I assumed you wanted to keep those (but based on my testing, if in addition to these changes, you also remove the warning about particle counts greater than 300, it would be ~1.9kb min+gzip)

I tried to only make changes that didn't have a very negative impact on readability.. but you might disagree and should of course feel free to ignore this PR if you prefer the code as currently written.


This is not necessarily ready to merge.. I need to do a bit more testing to ensure I didn't miss anything.

PuruVJ commented 1 year ago

Thanks for this! Im working on an action version of this. These changes will help immensely in that