Skip to content

Commit e631dbe

Browse files
committed
fix proxy readonly deprecated hooks error in webpack 5
1 parent 2405267 commit e631dbe

5 files changed

Lines changed: 7471 additions & 1 deletion

File tree

WrappedPlugin/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ const wrapHooks = (orig, pluginName, smp, type) => {
125125
get: (target, property) => {
126126
const raw = Reflect.get(target, property);
127127

128+
if (Object.isFrozen(target)) {
129+
return raw;
130+
}
131+
128132
if (property === "tap" && typeof raw === "function")
129133
return wrapTap(raw, pluginName, smp, type, method).bind(proxy);
130134
if (property === "tapAsync" && typeof raw === "function")

__tests__/setups/v4-html-webpack-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "v4-hard-source-webpack-plugin",
2+
"name": "v4-html-webpack-plugin",
33
"version": "0.0.1",
44
"description": "Test webpack v4, and HTML Webpack Plugin with SMP",
55
"scripts": {

0 commit comments

Comments
 (0)