CommonsChunkPlugin

CommonsChunkPlugin is an optional feature that creates a separate feature known as a chunk. Chunks consist of common modules shared between multiple entry points.

This plugin has been removed in Webpack 4 (Legato).

Looking into SplitChunkPlugin will show you more on how chunks are treated in Legato.

The resulting chunked file can be initially loaded once by separating the common modules that form the bundle. This is stored in the cache for later use.

Using the cache in this way will allow the browser to load pages quicker, rather than forcing it to load larger bundles.

Use the following declaration in your configuration to use this plugin:

new webpack.optimize.CommonsChunkPlugin(options);

A short and simple installation, but worth the introduction. Next, let's work with ContextReplacementPlugin.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.41.187