vapor.js is too large
asiekierka opened this issue · 2 comments
vapor.js's code is too large and causes a slowdown to my newest project. Is there really no way to make it smaller? Have you tried writing a better minifyer?
There has been some research into making the library smaller. This is alpha, but you can use it yourself right now:
Purely coincidentally, minifying the library with the new alpha minifier results in the exact same bytes as an empty file, which means you can benefit from the library without even requesting it in the first place.
After reading this (rather old) post, I knew I had to contribute. I've spent many hours working on reducing the file size of vapor.js and I'm happy to say... success!
Dubbed "inverted filesize mode", here's how it works:
- Include vapor.js using the 4th method (omission of <script> tag)
- Omit the (unnecessary) closing tags </body> and </html>
TADA!!! Vapor now reduces your application or website's file size by 14 bytes! Even Google implements vapor.js using this method.