Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/soundcloud/move-to-parent-merging-webpack-plugin
https://github.com/soundcloud/move-to-parent-merging-webpack-plugin
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/soundcloud/move-to-parent-merging-webpack-plugin
- Owner: soundcloud
- License: mit
- Created: 2014-09-03T07:31:27.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2023-04-09T20:59:13.000Z (over 1 year ago)
- Last Synced: 2024-09-26T20:54:39.899Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 19
- Watchers: 168
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
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][1] in the repo to illustrate how this works.
## Usage
Install with npm:```shell
npm install move-to-parent-merging-webpack-plugin
```Then, use as a plugin in your `webpack.config.js`:
```javascript
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.)[1]: example/webpack.config.js