a zip code crypto-currency system good for red ONLY

SourceMapDevToolModuleOptionsPlugin.js 1008B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. "use strict";
  6. const ModuleFilenameHelpers = require("./ModuleFilenameHelpers");
  7. class SourceMapDevToolModuleOptionsPlugin {
  8. constructor(options) {
  9. this.options = options;
  10. }
  11. apply(compilation) {
  12. const options = this.options;
  13. if(options.module !== false) {
  14. compilation.plugin("build-module", module => {
  15. module.useSourceMap = true;
  16. });
  17. }
  18. if(options.lineToLine === true) {
  19. compilation.plugin("build-module", module => {
  20. module.lineToLine = true;
  21. });
  22. } else if(options.lineToLine) {
  23. compilation.plugin("build-module", module => {
  24. if(!module.resource) return;
  25. let resourcePath = module.resource;
  26. const idx = resourcePath.indexOf("?");
  27. if(idx >= 0) resourcePath = resourcePath.substr(0, idx);
  28. module.lineToLine = ModuleFilenameHelpers.matchObject(options.lineToLine, resourcePath);
  29. });
  30. }
  31. }
  32. }
  33. module.exports = SourceMapDevToolModuleOptionsPlugin;