{"id":20563,"library":"speed-measure-webpack-plugin","title":"speed-measure-webpack-plugin","description":"Measure and analyse the speed of your webpack loaders and plugins. Current stable version is 1.6.0, released in 2024 after a period of inactivity. Supports webpack 1 through 5, Node >=6. Key differentiator: it wraps your existing webpack config to add timing instrumentation without modifying your original configuration. Output can be human-readable, JSON, or custom. Commonly used to identify bottlenecks in build performance. Active development now maintained by 18ways.","status":"active","version":"1.6.0","language":"javascript","source_language":"en","source_url":"https://github.com/stephencookdev/speed-measure-webpack-plugin","tags":["javascript"],"install":[{"cmd":"npm install speed-measure-webpack-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add speed-measure-webpack-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add speed-measure-webpack-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Terminal color support for output formatting","package":"chalk","optional":false}],"imports":[{"note":"CommonJS requires using require(). No default or named ESM export available. Use '.wrap()' method.","wrong":"import SpeedMeasurePlugin from 'speed-measure-webpack-plugin'; // Not ESM-friendly","symbol":"SpeedMeasurePlugin","correct":"const SpeedMeasurePlugin = require('speed-measure-webpack-plugin');\nconst smp = new SpeedMeasurePlugin();\nconst wrappedConfig = smp.wrap(originalConfig);"},{"note":"The package exports the constructor directly via module.exports, not as a named export.","wrong":"const { SpeedMeasurePlugin } = require('speed-measure-webpack-plugin');","symbol":"SpeedMeasurePlugin","correct":"const SpeedMeasurePlugin = require('speed-measure-webpack-plugin');"},{"note":"Always create an instance first (with optional options) then call .wrap(). Do not call .wrap() on the prototype.","wrong":"new SpeedMeasurePlugin().wrap(originalConfig) // Missing instance reuse or options","symbol":"wrap","correct":"const wrappedConfig = smp.wrap(originalConfig);"}],"quickstart":{"code":"const SpeedMeasurePlugin = require('speed-measure-webpack-plugin');\nconst path = require('path');\n\nconst smp = new SpeedMeasurePlugin({\n  outputFormat: 'human',\n  outputTarget: console.log,\n});\n\nconst webpackConfig = {\n  entry: './src/index.js',\n  output: {\n    path: path.resolve(__dirname, 'dist'),\n    filename: 'bundle.js',\n  },\n  plugins: [\n    new (require('webpack').DefinePlugin)({ 'process.env.NODE_ENV': JSON.stringify('production') }),\n  ],\n  module: {\n    rules: [\n      {\n        test: /\\.js$/,\n        exclude: /node_modules/,\n        use: {\n          loader: 'babel-loader',\n        },\n      },\n    ],\n  },\n};\n\nconst wrappedConfig = smp.wrap(webpackConfig);\nmodule.exports = wrappedConfig;","lang":"javascript","description":"Basic setup wrapping a webpack config with SMP to measure build times."},"warnings":[{"fix":"Use smp.wrap(config) instead of smp.wrapPlugins(config).","message":"API changed in v1.0.0: removed .wrapPlugins() in favor of .wrap().","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use 'human', 'humanVerbose', 'json', or a custom function.","message":"Option 'outputFormat' string values other than 'human', 'humanVerbose', 'json' are deprecated.","severity":"deprecated","affected_versions":">=0.3.0"},{"fix":"Add such plugins to options.excludedPlugins array.","message":"SMP wraps plugin constructors; some plugins may not proxy correctly (e.g., MiniCssExtractPlugin).","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Call smp.wrap() on each individual config object.","message":"SMP does not support webpack config as a function (multiple configurations).","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Run npm install --save-dev @types/speed-measure-webpack-plugin","message":"If using TypeScript, you must install @types/speed-measure-webpack-plugin separately.","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":"Use const SpeedMeasurePlugin = require('speed-measure-webpack-plugin');","cause":"Using default import (ESM) instead of require().","error":"TypeError: smp.wrap is not a function"},{"fix":"Ensure the plugin instance is passed in the plugins array and its constructor name is correct.","cause":"Missing plugin in plugins array or mismatched name/constructor.","error":"Error: Plugin name not found. Make sure to use correct constructor."},{"fix":"Run npm install --save-dev speed-measure-webpack-plugin. For Neutrino, require('speed-measure-webpack-plugin/neutrino').","cause":"Package not installed or wrong import path for Neutrino preset.","error":"Module not found: Can't resolve 'speed-measure-webpack-plugin'"},{"fix":"Set outputTarget to a string (file path) or a function (e.g., console.log).","cause":"outputTarget set to an invalid type (e.g., number).","error":"outputTarget is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}