webpack/lib/HotUpdateChunk.js

32 lines
688 B
JavaScript
Raw Normal View History

/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
2018-07-30 23:08:51 +08:00
"use strict";
const Chunk = require("./Chunk");
/** @typedef {import("./ChunkGraph")} ChunkGraph */
/** @typedef {import("./util/createHash").Hash} Hash */
class HotUpdateChunk extends Chunk {
constructor() {
super();
2018-05-11 19:16:27 +08:00
/** @type {(string|number)[]} */
this.removedModules = undefined;
}
2018-11-24 02:22:29 +08:00
/**
* @param {Hash} hash hash (will be modified)
* @param {ChunkGraph} chunkGraph the chunk graph
* @returns {void}
*/
2018-11-24 02:22:29 +08:00
updateHash(hash, chunkGraph) {
super.updateHash(hash, chunkGraph);
hash.update(JSON.stringify(this.removedModules));
}
}
module.exports = HotUpdateChunk;