Skip to content

Commit 07caba0

Browse files
Merge pull request #163 from hanzooo/master
fix: avoid function properties lost
2 parents adfcc4c + 0654ce5 commit 07caba0

File tree

4 files changed

+6723
-1
lines changed

4 files changed

+6723
-1
lines changed

WrappedPlugin/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,12 @@ const wrap = (orig, pluginName, smp, addEndEvent) => {
238238
Object.defineProperty(ret, "name", {
239239
value: raw.name,
240240
});
241-
return ret;
241+
const funcProxy = new Proxy(ret, {
242+
get: (target, property) => {
243+
return raw[property];
244+
},
245+
});
246+
return funcProxy;
242247
}
243248

244249
return raw;

0 commit comments

Comments
 (0)