UI for Zipcoin Blue

ModuleDependencyTemplateAsId.js 629B

12345678910111213141516171819202122
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. "use strict";
  6. class ModuleDependencyTemplateAsId {
  7. apply(dep, source, outputOptions, requestShortener) {
  8. if(!dep.range) return;
  9. const comment = outputOptions.pathinfo ?
  10. `/*! ${requestShortener.shorten(dep.request)} */ ` : "";
  11. let content;
  12. if(dep.module)
  13. content = comment + JSON.stringify(dep.module.id);
  14. else
  15. content = require("./WebpackMissingModule").module(dep.request);
  16. source.replace(dep.range[0], dep.range[1] - 1, content);
  17. }
  18. }
  19. module.exports = ModuleDependencyTemplateAsId;