Socket
Socket
Sign inDemoInstall

speed-measure-webpack-plugin

Package Overview
Dependencies
309
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.3.2 to 0.3.3

2

package.json
{
"name": "speed-measure-webpack-plugin",
"version": "0.3.2",
"version": "0.3.3",
"description": "Measure + analyse the speed of your webpack loaders and plugins",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -10,4 +10,7 @@ let idInc = 0;

// call, so we just set it multiple times, letting each one override the last
const addEndEvent = () =>
let endCallCount = 0;
const addEndEvent = () => {
endCallCount++;
smp.addTimeEvent("plugins", timeEventName, "end", { id });
};

@@ -22,4 +25,8 @@ smp.addTimeEvent("plugins", timeEventName, "start", {

);
addEndEvent();
// If the end event was invoked as a callback immediately, we can
// don't want to add another end event here (and it can actually cause
// errors, if webpack has finished compilation entirely)
if (!endCallCount) addEndEvent();
return ret;

@@ -50,15 +57,15 @@ };

const shouldWrap = getShouldWrap(orig);
const shouldSoftWrap = Object.values(orig).some(getShouldWrap);
const shouldSoftWrap = Object.keys(orig)
.map(k => orig[k])
.some(getShouldWrap);
if (!shouldWrap && !shouldSoftWrap) {
const vanillaFunc =
typeof orig === "function" &&
orig &&
orig.prototype &&
orig.prototype.constructor !== orig;
const vanillaFunc = orig.name === "next";
return vanillaFunc
? function() {
const ret = orig();
// do this before calling the callback, since the callback can start
// the next plugin step
addEndEvent();
return ret;
return orig.apply(this, arguments);
}

@@ -65,0 +72,0 @@ : orig;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc