You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
792 B

4 years ago
  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(options) {
  9. this.sourceUrlComment = options.sourceUrlComment;
  10. this.moduleFilenameTemplate = options.moduleFilenameTemplate;
  11. this.namespace = options.namespace;
  12. }
  13. apply(compiler) {
  14. compiler.hooks.compilation.tap("EvalDevToolModulePlugin", compilation => {
  15. new EvalDevToolModuleTemplatePlugin({
  16. sourceUrlComment: this.sourceUrlComment,
  17. moduleFilenameTemplate: this.moduleFilenameTemplate,
  18. namespace: this.namespace
  19. }).apply(compilation.moduleTemplates.javascript);
  20. });
  21. }
  22. }
  23. module.exports = EvalDevToolModulePlugin;