LimitChunkCountPlugin

LimitChunkCountPlugin is used when loading on-demand because many code splits can be used. When compiling, you might notice that some chunks are very small, which creates a larger HTTP overhead. LimitChunkCountPlugin can postprocess chunks by merging them.

Limiting the maximum number of chunks can be done by using a value greater than or equal to 1. Using 1 prevents additional chunks from being added as the main or entry point chunk:

[/plugins/min-chunk-size-plugin]

Keeping the chunk size above the specified limit is not a feature you will find in Webpack 5; MinChuckSizePlugin should be used, instead, in this situation.

That concludes our introduction to plugins and this chapter in general. Plugins allow Webpack to work in a variety of ways and Webpack enables developers to build loaders and plug gaps in functionality issues. They are indispensable when working on a larger scale project or complex projects that require automation.

Our section on APIs showed you how, sometimes, we don't always want to use local code and provided you with an excellent transition to libraries, which we will discuss in the next chapter.

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

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