Skip to content

Commit 6192e5b

Browse files
committed
Use hooks instead of applyPlugins
1 parent dc90e70 commit 6192e5b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/Compilation.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1695,12 +1695,12 @@ class Compilation extends Tapable {
16951695
chunkGroup.checkConstraints();
16961696
}
16971697
}
1698-
1699-
applyPlugins(name, ...args) {
1700-
this.hooks[name.replace(/[- ]([a-z])/g, match => match[1].toUpperCase())].call(...args);
1701-
}
17021698
}
17031699

1700+
Compilation.prototype.applyPlugins = util.deprecate(function(name, ...args) {
1701+
this.hooks[name.replace(/[- ]([a-z])/g, match => match[1].toUpperCase())].call(...args);
1702+
}, "Compilation.applyPlugins is deprecated. Use new API on `.hooks` instead");
1703+
17041704
Object.defineProperty(Compilation.prototype, "moduleTemplate", {
17051705
configurable: false,
17061706
get: util.deprecate(function() {

lib/HotModuleReplacementPlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ module.exports = class HotModuleReplacementPlugin {
130130
compilation.assets[filename] = source;
131131
hotUpdateMainContent.c[chunkId] = true;
132132
currentChunk.files.push(filename);
133-
compilation.applyPlugins("chunk-asset", currentChunk, filename);
133+
compilation.hooks.chunkAsset.call("HotModuleReplacementPlugin", currentChunk, filename);
134134
}
135135
} else {
136136
hotUpdateMainContent.c[chunkId] = false;

0 commit comments

Comments
 (0)