Skip to content

Commit 72f904a

Browse files
committed
run splitChunks and runtimeChunk only on main compiliation
1 parent 02f8c96 commit 72f904a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/optimize/RuntimeChunkPlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = class RuntimeChunkPlugin {
88
constructor(options) {}
99

1010
apply(compiler) {
11-
compiler.hooks.compilation.tap("RuntimeChunkPlugin", compilation => {
11+
compiler.hooks.thisCompilation.tap("RuntimeChunkPlugin", compilation => {
1212
compilation.hooks.optimizeChunksAdvanced.tap("RuntimeChunkPlugin", () => {
1313
for(const entrypoint of compilation.entrypoints.values()) {
1414
const chunk = entrypoint.getRuntimeChunk();

lib/optimize/SplitChunksPlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ module.exports = class SplitChunksPlugin {
176176
}
177177

178178
apply(compiler) {
179-
compiler.hooks.compilation.tap("SplitChunksPlugin", compilation => {
179+
compiler.hooks.thisCompilation.tap("SplitChunksPlugin", compilation => {
180180
let alreadyOptimized = false;
181181
compilation.hooks.unseal.tap("SplitChunksPlugin", () => {
182182
alreadyOptimized = false;

0 commit comments

Comments
 (0)