move-to-parent-merging-webpack-plugin

A simple merging plugin that attempts to lift modules required by several child chunks up to the parent chunk. This is mostly useful if you are code-splitting your bundles into one primary (entry) chunk and several smaller chunks that all have similar dep

Showing:

Popularity

Downloads/wk

1

GitHub Stars

19

Maintenance

Last Commit

5mos ago

Contributors

2

Package

Dependencies

0

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

MoveToParentMergingPlugin

A simple merging plugin that attempts to lift modules required by several child chunks up to the parent chunk. This is mostly useful if you are code-splitting your bundles into one primary (entry) chunk and several smaller chunks that all have similar dependencies.

Modules will only be moved from a chunk if, for all chunks that contain that module, there is a common parent chunk.

There is a simple example in the repo to illustrate how this works.

Usage

Install with npm:

npm install move-to-parent-merging-webpack-plugin

Then, use as a plugin in your webpack.config.js:

var MoveToParentMergingPlugin = require('move-to-parent-merging-webpack-plugin');

module.exports = {
    
    ... your config ...

    plugins: [
        new MoveToParentMergingPlugin();
    ]
};

MoveToParentMerginPlugin([chunkCount])

The plugin can optionally take an argument that specifies how many chunks must contain a module for it to be considered "common" enough to be lifted to a parent chunk. Default = 2 (aggressive.)

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial