Work in progress
Plugin for generating insightful data about your Webpack runtime memory consumption.
The plugin watches for a rss memory consumption over a threshold, and when the memory is greater logs a .heapsnapshot
that can be loaded in the chrome developer tools or heapviz.com
npm i -D memory-usage-webpack-plugin
const MemoryUsageWebpackPlugin = require('memory-usage-webpack-plugin')
module.exports = {
// webpackConfig,
plugins: [
// ...plugins,
new MemoryUsageWebpackPlugin({
// ...options
})
]
}
Param | Type | Default | Description |
---|---|---|---|
threshold | number |
1024 |
Memory in mb when to save the first heapsnaptshot |
tresholdIncrease | number |
100 |
Memory in mb to increase threshold after a threshold is reached |
snaptshotOnKill | boolean |
true |
Logs a heapsnaptshot when a kill -9 kills the process |
snaptshotOnSignal | boolean |
true |
Logs a heapsnaptshot when a kill -USR2 kills the process |