ModuleTemplate.js 885 B

1234567891011121314151617181920212223
  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. module.exports = class ModuleTemplate extends Template {
  8. constructor(outputOptions) {
  9. super(outputOptions);
  10. }
  11. render(module, dependencyTemplates, chunk) {
  12. const moduleSource = module.source(dependencyTemplates, this.outputOptions, this.requestShortener);
  13. const moduleSourcePostModule = this.applyPluginsWaterfall("module", moduleSource, module, chunk, dependencyTemplates);
  14. const moduleSourcePostRender = this.applyPluginsWaterfall("render", moduleSourcePostModule, module, chunk, dependencyTemplates);
  15. return this.applyPluginsWaterfall("package", moduleSourcePostRender, module, chunk, dependencyTemplates);
  16. }
  17. updateHash(hash) {
  18. hash.update("1");
  19. this.applyPlugins("hash", hash);
  20. }
  21. };