t4t5 / sweetalert

A beautiful replacement for JavaScript's "alert"
https://sweetalert.js.org
MIT License
22.4k stars 2.84k forks source link

Reduce size of library? #923

Open simplenotezy opened 4 years ago

simplenotezy commented 4 years ago

I think 40kb for this library is way too much (only counting the JS files).

It's half the size of jQuery3, and bootstrap 4 is 60 kb.

Afterall, it's an "alert" library?

aalfiann commented 3 years ago

If your server support gzip compression, then this library is very small, it's only 4kB (minified and gzipped).

You can check the size with this tool >> https://varvy.com/tools/gzip/ Just paste this link :

  1. SweetAlert 1 (4 kB) >> https://unpkg.com/sweetalert/dist/sweetalert.min.js
  2. SweetAlert 1 (29 kB) >> https://cdn.jsdelivr.net/npm/sweetalert/dist/sweetalert.min.js
  3. SweetAlert 2 (53 kB) >> https://cdn.jsdelivr.net/npm/sweetalert2@10

I keep sticky with version 1 because this is very small. UNPKG is more better in compression size than JsDelivr.

iamandrewluca commented 3 years ago

https://bundlephobia.com/result?p=sweetalert@2.1.2

aalfiann commented 3 years ago

https://bundlephobia.com/result?p=sweetalert@2.1.2

That is the sweetalert 1..

Sweetalert2 is here >> https://bundlephobia.com/result?p=sweetalert2@10.16.6

iamandrewluca commented 3 years ago

😄 damn 72.4kB MINIFIED