{"id":20564,"library":"speed-measure-webpack-v5-plugin","title":"Speed Measure Webpack Plugin (v5 fork)","description":"A Webpack plugin that measures the execution time of loaders and plugins during builds, helping developers identify performance bottlenecks. Current stable version is 1.5.2, compatible with Webpack versions 1 through 5. This is a community fork of stephencookdev/speed-measure-webpack-plugin, specifically updated for Webpack v5. The primary differentiator is its ability to exclude certain plugins from measurement to avoid build failures (e.g., with ReactRefreshPlugin or MiniCssExtractPlugin). It supports multiple output formats (human, JSON, custom) and can write results to a file. Release cadence is low; last update was around 2021.","status":"active","version":"1.5.2","language":"javascript","source_language":"en","source_url":"https://github.com/rising-entropy/speed-measure-webpack-v5-plugin","tags":["javascript"],"install":[{"cmd":"npm install speed-measure-webpack-v5-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add speed-measure-webpack-v5-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add speed-measure-webpack-v5-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; works with webpack 1-5","package":"webpack","optional":false}],"imports":[{"note":"Package does not export ESM; use CommonJS require. There is no default export for ES modules.","wrong":"import SpeedMeasurePlugin from 'speed-measure-webpack-v5-plugin';","symbol":"SpeedMeasurePlugin","correct":"const SpeedMeasurePlugin = require('speed-measure-webpack-v5-plugin');"},{"note":"Named import does not exist; must import default even if using ESM syntax with bundler that handles CJS interop.","wrong":"import { SpeedMeasurePlugin } from 'speed-measure-webpack-v5-plugin';","symbol":"SpeedMeasurePlugin","correct":"import SpeedMeasurePlugin from 'speed-measure-webpack-v5-plugin';"}],"quickstart":{"code":"const SpeedMeasurePlugin = require('speed-measure-webpack-v5-plugin');\nconst smp = new SpeedMeasurePlugin();\n\nconst webpackConfig = smp.wrap({\n  entry: './src/index.js',\n  output: {\n    path: __dirname + '/dist',\n    filename: 'bundle.js'\n  },\n  plugins: [\n    // your plugins\n  ],\n  module: {\n    rules: [\n      {\n        test: /\\.js$/,\n        exclude: /node_modules/,\n        use: 'babel-loader'\n      }\n    ]\n  }\n});\n\nmodule.exports = webpackConfig;","lang":"javascript","description":"Demonstrates basic usage: wrap your webpack config with smp.wrap() to measure build times."},"warnings":[{"fix":"smp.wrap(config, ['ReactRefreshPlugin', 'MiniCssExtractPlugin'])","message":"When using certain plugins (e.g., ReactRefreshPlugin, MiniCssExtractPlugin), SMP may cause build failures or break HMR. Must exclude these plugins via the second argument to wrap().","severity":"gotcha","affected_versions":">=1.0.0 <2.0.0"},{"fix":"Replace require('speed-measure-webpack-plugin') with require('speed-measure-webpack-v5-plugin').","message":"The original package 'speed-measure-webpack-plugin' is not maintained for webpack v5. Users should migrate to this fork.","severity":"deprecated","affected_versions":">=0"},{"fix":"Disable persistent caching when measuring: set cache: false in webpack config.","message":"SMP does not support webpack v5's persistent caching; measurements may be inaccurate if persistent caching is enabled.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install --save-dev speed-measure-webpack-v5-plugin'","cause":"Package not installed or incorrectly spelled.","error":"Error: Cannot find module 'speed-measure-webpack-v5-plugin'"},{"fix":"Use: const SpeedMeasurePlugin = require('speed-measure-webpack-v5-plugin');\nconst smp = new SpeedMeasurePlugin();","cause":"Importing incorrectly (e.g., named import instead of default).","error":"TypeError: smp.wrap is not a function"},{"fix":"Exclude problematic plugins via smp.wrap(config, ['PluginName']). If issue persists, use older webpack version.","cause":"SMP is incompatible with webpack v5's new Compilation instance. This may occur when using certain plugins.","error":"Module build failed: TypeError: The 'compilation' argument must be an instance of Compilation"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}