Code Splitting

Create-React-App (1.2) uses Webpack to bundle all the '.js' files into one minimized obfuscated '.js' file by following your 'import' statements. The single bundle file can then be included in your HTML file.

However, as the size of your bundle file grows, this can slow down loading, since everything is always loaded at once. To make loading more efficient, you should split the bundle file and load only the necessary libraries. There are three ways to do this: dynamic ECMAScript import(),React.lazy(), and the loadable-components library.