- Use code splitting and create multiple entry points .
- The more notable feature is that Code Splitting can be used to split code into an on demand loaded chunk.
- To clarify a common misunderstanding: Code Splitting is not just about extracting common code into a shared chunk.
- The feature is called “code splitting”.
- Additional chunks can be shared between these entry chunks and modules are only built once.
Bundling and chunking strategies used in Housing Go
For big web apps it’s not efficient to put all code into a single file, especially if some blocks of code are only required under some circumstances. Webpack has a feature to split your codebase into “chunks” which are loaded on demand. Some other bundlers call them “layers”, “rollups”, or “fragments”. This feature is called “code splitting”.
If you need multiple bundles for multiple HTML pages you can use the “multiple entry points” feature. It will build multiple bundles at once. Additional chunks can be shared between these entry chunks and modules are only built once.