DEV Community

Cover image for Decreasing Your Website Bundle Size
shadowtime2000
shadowtime2000

Posted on

Decreasing Your Website Bundle Size

How To

Just put this in your webpage:

<script src="https://cdn.jsdelivr.net/gh/shadowtime2000/easy-dom/src/index.js"></script>
Enter fullscreen mode Exit fullscreen mode

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.

Top comments (0)