a zip code crypto-currency system good for red ONLY

HotUpdateChunkTemplate.js 1.0KB

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. "use strict";
  6. const Template = require("./Template");
  7. const Chunk = require("./Chunk");
  8. module.exports = class HotUpdateChunkTemplate extends Template {
  9. constructor(outputOptions) {
  10. super(outputOptions);
  11. }
  12. render(id, modules, removedModules, hash, moduleTemplate, dependencyTemplates) {
  13. const hotUpdateChunk = new Chunk();
  14. hotUpdateChunk.id = id;
  15. hotUpdateChunk.setModules(modules);
  16. hotUpdateChunk.removedModules = removedModules;
  17. const modulesSource = this.renderChunkModules(hotUpdateChunk, moduleTemplate, dependencyTemplates);
  18. const core = this.applyPluginsWaterfall("modules", modulesSource, modules, removedModules, moduleTemplate, dependencyTemplates);
  19. const source = this.applyPluginsWaterfall("render", core, modules, removedModules, hash, id, moduleTemplate, dependencyTemplates);
  20. return source;
  21. }
  22. updateHash(hash) {
  23. hash.update("HotUpdateChunkTemplate");
  24. hash.update("1");
  25. this.applyPlugins("hash", hash);
  26. }
  27. };