Skip to content

Commit 1818c22

Browse files
Fix the names of any wrapped functions, so as to appear unwrapped (to fix HardSourceWebpackPlugin)
1 parent 36487a4 commit 1818c22

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

WrappedPlugin/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,12 @@ const wrap = (orig, pluginName, smp, addEndEvent) => {
8181
getOrigConstrucName(target)
8282
).bind(proxy);
8383

84-
if (typeof orig[property] === "function")
85-
return orig[property].bind(proxy);
84+
if (typeof orig[property] === "function") {
85+
const ret = orig[property].bind(proxy);
86+
if (property === "constructor")
87+
Object.defineProperty(ret, "name", { value: orig.constructor.name });
88+
return ret;
89+
}
8690
return wrap(orig[property], pluginName, smp);
8791
},
8892
set: (target, property, value) => {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "speed-measure-webpack-plugin",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "Measure + analyse the speed of your webpack loaders and plugins",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)