Hacker News new | ask | show | jobs
by scotttrinh 3622 days ago
> Next, the dynamic nature of JavaScript is to blame. You can't easily extract and compile just the functions you need.

Definitely check out rollup, if you haven't heard of it. We (the JavaScript community) are working towards solving this!

1 comments

Thanks for the tip, rollup looks really powerful.

This and related comments remind me that the latest ECMA stuff offers a brighter future. The challenge is getting there...

Can/will jQuery work with rollup and all the other new module work? Or does it have to be effectively rewritten?

It needs to be rewritten, unfortunately. However this isn't just rewriting it so it works with one tool, since this is the new module syntax. I imagine that a future version of jQuery, and probably most libraries going forward, will want to take advantage of ES2015 modules, even if it's just to aid in their own internal development. Since we have module bundlers like rollup, it would be easy to still provide an ES5 bundle for environments that do not use ES2015 modules yet.