3 ms·
Modern JavaScript is developed in separate modules (i.e. files).
by yawaramin 9y ago
Modern JavaScript is developed in separate modules (i.e. files).
- mort96 9y agoDeveloped, yes, but in general, your build system bundles it all up into one javascript file which is sent to the browser. Even if you don't bundle the javascript, all the code has to be sent to the browser anyways, just over multiple HTTP requests instead of one.
- yawaramin 9y agoRight, but there can be many bundles for complex sites like Facebook. They can have a bundle for Messenger.com since it's a SPA, another for the FB home page, others for object pages, search pages, etc. etc....
- Can_Not 9y agoExcept for small or basic apps, your build system is not suppose to build to only one file. It's suppose to build to a main file and separated module files. The module loader will pull in modules only when needed.