Registry / devops / speed-measure-webpack-plugin

speed-measure-webpack-plugin

JSON →
library1.6.0jsnpmunverified

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.

npm install speed-measure-webpack-plugin
INSTALL
IMPORT
SIG · SPEED-MEASURE-WEBP
S
speed-measure-webpack-plugin
devopsjavascriptv1.6.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SpeedMeasurePlugin
const SpeedMeasurePlugin = require('speed-measure-webpack-plugin'); const smp = new SpeedMeasurePlugin(); const wrappedConfig = smp.wrap(originalConfig);
import SpeedMeasurePlugin from 'speed-measure-webpack-plugin'; // Not ESM-friendly
CommonJS requires using require(). No default or named ESM export available. Use '.wrap()' method.
SpeedMeasurePlugin
const SpeedMeasurePlugin = require('speed-measure-webpack-plugin');
const { SpeedMeasurePlugin } = require('speed-measure-webpack-plugin');
The package exports the constructor directly via module.exports, not as a named export.
wrap
const wrappedConfig = smp.wrap(originalConfig);
new SpeedMeasurePlugin().wrap(originalConfig) // Missing instance reuse or options
Always create an instance first (with optional options) then call .wrap(). Do not call .wrap() on the prototype.

Basic setup wrapping a webpack config with SMP to measure build times.

const SpeedMeasurePlugin = require('speed-measure-webpack-plugin'); const path = require('path'); const smp = new SpeedMeasurePlugin({ outputFormat: 'human', outputTarget: console.log, }); const webpackConfig = { entry: './src/index.js', output: { path: path.resolve(__dirname, 'dist'), filename: 'bundle.js', }, plugins: [ new (require('webpack').DefinePlugin)({ 'process.env.NODE_ENV': JSON.stringify('production') }), ], module: { rules: [ { test: /\.js$/, exclude: /node_modules/, use: { loader: 'babel-loader', }, }, ], }, }; const wrappedConfig = smp.wrap(webpackConfig); module.exports = wrappedConfig;
Debug
Known issues
breakingAPI changed in v1.0.0: removed .wrapPlugins() in favor of .wrap().
fix
Use smp.wrap(config) instead of smp.wrapPlugins(config).
affects: >=1.0.0
deprecatedOption 'outputFormat' string values other than 'human', 'humanVerbose', 'json' are deprecated.
fix
Use 'human', 'humanVerbose', 'json', or a custom function.
affects: >=0.3.0
gotchaSMP wraps plugin constructors; some plugins may not proxy correctly (e.g., MiniCssExtractPlugin).
fix
Add such plugins to options.excludedPlugins array.
affects: >=1.0.0
gotchaSMP does not support webpack config as a function (multiple configurations).
fix
Call smp.wrap() on each individual config object.
affects: >=0.1.0
gotchaIf using TypeScript, you must install @types/speed-measure-webpack-plugin separately.
fix
Run npm install --save-dev @types/speed-measure-webpack-plugin
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: smp.wrap is not a function
Using default import (ESM) instead of require().
fix
Use const SpeedMeasurePlugin = require('speed-measure-webpack-plugin');
Error: Plugin name not found. Make sure to use correct constructor.
Missing plugin in plugins array or mismatched name/constructor.
fix
Ensure the plugin instance is passed in the plugins array and its constructor name is correct.
Module not found: Can't resolve 'speed-measure-webpack-plugin'
Package not installed or wrong import path for Neutrino preset.
fix
Run npm install --save-dev speed-measure-webpack-plugin. For Neutrino, require('speed-measure-webpack-plugin/neutrino').
outputTarget is not a function
outputTarget set to an invalid type (e.g., number).
fix
Set outputTarget to a string (file path) or a function (e.g., console.log).
Upgrade
Version history
1.6.0latest on npm
Audit
Dependencies
chalkrequiredTerminal color support for output formatting
Agent activity
6 hits · last 30 days
node
6
Resources
speed-measure-webpack-plugin — npm install speed-measure-webpack-plugin · libregistry