mirror of https://github.com/webpack/webpack.git
Merge pull request #6375 from webpack/bugfix/optimization-only-on-main
run splitChunks and runtimeChunk only on main compiliation
This commit is contained in:
commit
0857defcbe
|
|
@ -8,7 +8,7 @@ module.exports = class RuntimeChunkPlugin {
|
|||
constructor(options) {}
|
||||
|
||||
apply(compiler) {
|
||||
compiler.hooks.compilation.tap("RuntimeChunkPlugin", compilation => {
|
||||
compiler.hooks.thisCompilation.tap("RuntimeChunkPlugin", compilation => {
|
||||
compilation.hooks.optimizeChunksAdvanced.tap("RuntimeChunkPlugin", () => {
|
||||
for(const entrypoint of compilation.entrypoints.values()) {
|
||||
const chunk = entrypoint.getRuntimeChunk();
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ module.exports = class SplitChunksPlugin {
|
|||
}
|
||||
|
||||
apply(compiler) {
|
||||
compiler.hooks.compilation.tap("SplitChunksPlugin", compilation => {
|
||||
compiler.hooks.thisCompilation.tap("SplitChunksPlugin", compilation => {
|
||||
let alreadyOptimized = false;
|
||||
compilation.hooks.unseal.tap("SplitChunksPlugin", () => {
|
||||
alreadyOptimized = false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue