ryanelian / aspnet-validation

Enables ASP.NET MVC client-side validation without jQuery!
MIT License
40 stars 13 forks source link

Use Rollup instead of WebPack? #1

Open ryanelian opened 7 years ago

ryanelian commented 7 years ago

Rollup was created for a different reason: to build flat distributables of JavaScript libraries as efficiently as possible, taking advantage of the ingenious design of ES2015 modules. Other module bundlers — webpack included — work by wrapping each module in a function, putting them in a bundle with a browser-friendly implementation of require, and evaluating them one-by-one. That’s great if you need things like on-demand loading, but otherwise it’s a bit of a waste, and it gets worse if you have lots of modules. ES2015 modules enable a different approach, which Rollup uses. All your code is put in the same place and evaluates in one go, resulting in leaner, simpler code that starts up faster. You can see it for yourself with the Rollup REPL. Use webpack for apps, and Rollup for libraries

https://medium.com/webpack/webpack-and-rollup-the-same-but-different-a41ad427058c

KSib commented 5 years ago

It looks like this article is now a fair bit out of date. This is linked from the page above: https://nolanlawson.com/2016/08/15/the-cost-of-small-modules/

Update (21 May 2018): This blog post analyzed older versions of Webpack, Browserify, and other module bundlers. Later versions of these bundlers added support for features like module concatenation and flat packing, which address most of the concerns raised in this blog post. You can get an idea for the performance improvement from these methods in these PRs.

Noted PR: https://github.com/nolanlawson/cost-of-small-modules/pull/10