EvalDevToolModulePlugin.js 668 B

12345678910111213141516171819202122
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. "use strict";
  6. const EvalDevToolModuleTemplatePlugin = require("./EvalDevToolModuleTemplatePlugin");
  7. class EvalDevToolModulePlugin {
  8. constructor(sourceUrlComment, moduleFilenameTemplate) {
  9. this.sourceUrlComment = sourceUrlComment;
  10. this.moduleFilenameTemplate = moduleFilenameTemplate;
  11. }
  12. apply(compiler) {
  13. compiler.plugin("compilation", (compilation) => {
  14. compilation.moduleTemplate.apply(new EvalDevToolModuleTemplatePlugin(this.sourceUrlComment, this.moduleFilenameTemplate));
  15. });
  16. }
  17. }
  18. module.exports = EvalDevToolModulePlugin;