A webpack plugin to measure memory usage during the build process.
Install the plugin.
npm install memory-usage-webpack-plugin --save-dev
To use the plugin, add it to your webpack configuration:
const MemoryUsageWebpackPlugin = require('memory-usage-webpack-plugin');
module.exports = {
// ... other configurations
plugins: [
new MemoryUsageWebpackPlugin({
logTimeout: 1000, // 1 second
warningThreshold: 100 * 1024 * 1024, // 100 MB
}),
],
};
The plugin accepts the following options:
logTimeout
(number): The interval in milliseconds to log memory usage. Default:1000
(1 second).warningThreshold
(number): The memory usage threshold in bytes to trigger a warning. Default:1 * 1024 * 1024 * 1024
(1GB).