Registry /
devops / speed-measure-webpack-plugin
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
muslnode 18–226 runs
build_error
glibcnode 18–226 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;
Errors
Common errors & fixes
TypeError: smp.wrap is not a function
Using default import (ESM) instead of require().
fixUse 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.
fixEnsure 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.
fixRun 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).
fixSet outputTarget to a string (file path) or a function (e.g., console.log).
Audit
Dependencies
chalkrequiredTerminal color support for output formatting