RequireResolveContextDependency.js 887 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. "use strict";
  6. const ContextDependency = require("./ContextDependency");
  7. const CriticalDependencyWarning = require("./CriticalDependencyWarning");
  8. const ContextDependencyTemplateAsId = require("./ContextDependencyTemplateAsId");
  9. class RequireResolveContextDependency extends ContextDependency {
  10. constructor(request, recursive, regExp, range, valueRange) {
  11. super(request, recursive, regExp);
  12. this.range = range;
  13. this.valueRange = valueRange;
  14. }
  15. get type() {
  16. return "amd require context";
  17. }
  18. getWarnings() {
  19. if(!this.critical) {
  20. return;
  21. }
  22. return [
  23. new CriticalDependencyWarning(this.critical)
  24. ];
  25. }
  26. }
  27. RequireResolveContextDependency.Template = ContextDependencyTemplateAsId;
  28. module.exports = RequireResolveContextDependency;