NullDependency.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. "use strict";
  6. const Dependency = require("../Dependency");
  7. const DependencyTemplate = require("../DependencyTemplate");
  8. /** @typedef {import("webpack-sources").ReplaceSource} ReplaceSource */
  9. /** @typedef {import("../Dependency").TRANSITIVE} TRANSITIVE */
  10. /** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */
  11. class NullDependency extends Dependency {
  12. get type() {
  13. return "null";
  14. }
  15. /**
  16. * @returns {boolean | TRANSITIVE} true, when changes to the referenced module could affect the referencing module; TRANSITIVE, when changes to the referenced module could affect referencing modules of the referencing module
  17. */
  18. couldAffectReferencingModule() {
  19. return false;
  20. }
  21. }
  22. NullDependency.Template = class NullDependencyTemplate extends (
  23. DependencyTemplate
  24. ) {
  25. /**
  26. * @param {Dependency} dependency the dependency for which the template should be applied
  27. * @param {ReplaceSource} source the current replace source which can be modified
  28. * @param {DependencyTemplateContext} templateContext the context object
  29. * @returns {void}
  30. */
  31. apply(dependency, source, templateContext) {}
  32. };
  33. module.exports = NullDependency;