5 ms·
I've used Rollup and it worked extremely well for bundling JS that uses modules into a single file. The documentation is very good and the community is quite re
by apo 10y ago
I've used Rollup and it worked extremely well for bundling JS that uses modules into a single file. The documentation is very good and the community is quite responsive.
The only thing that would be better is not needing Rollup in the first place.
What's the current status of browser support for ES6 modules?
- maga 10y agoIn development in all browsers[1] meaning none has them yet. IIRC, one of the major roadblocks was the need to define <script type="module"> in the HTML standard[2] as well as the whole loading routine. Hence, the feature is coming later than the rest in ES2015. [1] https://www.chromestatus.com/features/5365692190687232 https://www.chromestatus.com/features/5365692190687232 [2] https://github.com/whatwg/html/pull/443 https://github.com/whatwg/html/pull/443
- MatthewPhillips 10y agoIt's available in Edge if you have Windows Insider (the Edge equivalent of Chrome Canary). There are some bugs there though. Note that the browser's module support is stricter than Node's, you have to point your imports to the specific file you want to import and include `.js` on the end, for example this won't work: https://github.com/mrdoob/three.js/blob/dev/src/materials/Material.js#L1 https://github.com/mrdoob/three.js/blob/dev/src/materials/Ma... in script[type=module]. So there will still need to be a refactor of THREE.js even after browser support starts coming in.
- dexwiz 10y agoWe probably won't see module, or a good module, until big HTTP2 support. Having a single file has some huge gains for HTTP, mostly in the overhead cost of a request. HTTP2 will get rid of some of that overhead via streaming files and header compression. Sending a ton of different javascript files is too costly right now.