When files must be organized in several different bundles, for instance, because the different bundles must be served in different web pages that need different JavaScript/TypeScript libraries, some optimization problems arise:
- Some modules belongs to external libraries that will not be modified during the project's development. Thus, it makes no sense to process them during the frequent builds of the JavaScript/TypeScript project files. It makes more sense to organize them in separate bundles that are processed once and for all when all the library packages are installed.
- If some modules are part of several bundles, it makes sense to factor them out into a separate bundle instead of duplicating them in all bundles. This way, the browser may cache them once and for all and they are not downloaded several times as parts of different bundles, thus reducing...