SMP follows semver. This guide should help with upgrading major versions.
If you're using the SpeedMeasurePlugin.wrapPlugins(plugins, options) static method, then
- remove all
.wrapPluginscalls - instantiate an
smp - call
smp.wrapon your entire config
e.g.
// v0
const webpackConfig = {
plugins: SpeedMeasurePlugin.wrapPlugins(
{
FooPlugin: new FooPlugin(),
},
smpOptions
),
};
// v1
const smp = new SpeedMeasurePlugin(smpOptions);
const webpackConfig = smp.wrap({
plugins: [new FooPlugin()],
});If you're using the smp.wrapPlugins(plugins) method, then
- remove all
.wrapPluginscalls - call
smp.wrapon your entire config
e.g.
// v0
const smp = new SpeedMeasurePlugin(smpOptions);
const webpackConfig = {
plugins: smp.wrapPlugins({
FooPlugin: new FooPlugin(),
}),
};
// v1
const smp = new SpeedMeasurePlugin(smpOptions);
const webpackConfig = smp.wrap({
plugins: [new FooPlugin()],
});v1 no longer requires you to manually enter each plugin name. If you want to keep any of your custom plugin names, then you can use the new options.pluginNames option:
const fooPlugin = new FooPlugin();
const smp = new SpeedMeasurePlugin({
pluginNames: {
customFooPluginName: fooPlugin,
},
});
const webpackConfig = smp.wrap({
plugins: [fooPlugin],
});