From 3677e25c3089a7bb5df5fa471d4b07c6668a9310 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Thu, 12 Apr 2018 11:04:49 +0200 Subject: [PATCH] add a separate class for HotUpdateChunk --- lib/HotUpdateChunk.js | 16 ++++++++++++++++ lib/HotUpdateChunkTemplate.js | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 lib/HotUpdateChunk.js diff --git a/lib/HotUpdateChunk.js b/lib/HotUpdateChunk.js new file mode 100644 index 000000000..17eaf1281 --- /dev/null +++ b/lib/HotUpdateChunk.js @@ -0,0 +1,16 @@ +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +"use strict"; + +const Chunk = require("./Chunk"); + +class HotUpdateChunk extends Chunk { + constructor() { + super(); + this.removedModules = undefined; + } +} + +module.exports = HotUpdateChunk; diff --git a/lib/HotUpdateChunkTemplate.js b/lib/HotUpdateChunkTemplate.js index 26288ac0f..92ab8db08 100644 --- a/lib/HotUpdateChunkTemplate.js +++ b/lib/HotUpdateChunkTemplate.js @@ -5,7 +5,7 @@ "use strict"; const Template = require("./Template"); -const Chunk = require("./Chunk"); +const HotUpdateChunk = require("./HotUpdateChunk"); const { Tapable, SyncWaterfallHook, SyncHook } = require("tapable"); module.exports = class HotUpdateChunkTemplate extends Tapable { @@ -41,7 +41,7 @@ module.exports = class HotUpdateChunkTemplate extends Tapable { moduleTemplate, dependencyTemplates ) { - const hotUpdateChunk = new Chunk(); + const hotUpdateChunk = new HotUpdateChunk(); hotUpdateChunk.id = id; hotUpdateChunk.setModules(modules); hotUpdateChunk.removedModules = removedModules;