How To

Just put this in your webpage:

<script src=""></script>

and then instead of using document use DOM and it saves you 5 bytes.

Improvements to original size of website

The more references you have to document the more bytes it can save. If you have more than 22 document references it starts decreasing your bundle instead of increasing.

Largely Used Libraries If They Use this

  • jquery would decrease their size by over 1kb
  • react would decrease their size by over 1kb
  • angular would decrease their size by over 2kb

Finishing Thoughts

So that is how you can decrease your website bundle size. If you liked this post and the library, star the library to support it.

Back |


If you are looking at this you probably wonder who I am; teenage open source maintainer

shadowtime2000's DEV profile image