forked from webpack/webpack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNodeHotUpdateChunkTemplate.js
More file actions
28 lines (25 loc) · 983 Bytes
/
NodeHotUpdateChunkTemplate.js
File metadata and controls
28 lines (25 loc) · 983 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
var HotUpdateChunkTemplate = require("../HotUpdateChunkTemplate");
function NodeHotUpdateChunkTemplate(outputOptions) {
HotUpdateChunkTemplate.call(this, outputOptions);
}
module.exports = NodeHotUpdateChunkTemplate;
NodeHotUpdateChunkTemplate.prototype = Object.create(HotUpdateChunkTemplate.prototype);
NodeHotUpdateChunkTemplate.prototype.renderHeader = function(id, modules, hash) {
var buf = HotUpdateChunkTemplate.prototype.renderHeader.call(this, id, modules, hash);
buf.unshift(
"exports.id = " + JSON.stringify(id) + ";\n",
"exports.modules = "
);
return buf;
};
NodeHotUpdateChunkTemplate.prototype.updateHash = function(hash) {
HotUpdateChunkTemplate.prototype.updateHash.call(this, hash);
hash.update("NodeHotUpdateChunkTemplate");
hash.update("3");
hash.update(this.outputOptions.hotUpdateFunction + "");
hash.update(this.outputOptions.library + "");
};