ContainerEntryDependency.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra, Zackary Jackson @ScriptedAlchemy, Marais Rossouw @maraisr
  4. */
  5. "use strict";
  6. const Dependency = require("../Dependency");
  7. const makeSerializable = require("../util/makeSerializable");
  8. /** @typedef {import("./ContainerEntryModule").ExposeOptions} ExposeOptions */
  9. /** @typedef {import("./ContainerEntryModule").ExposesList} ExposesList */
  10. class ContainerEntryDependency extends Dependency {
  11. /**
  12. * @param {string} name entry name
  13. * @param {ExposesList} exposes list of exposed modules
  14. * @param {string} shareScope name of the share scope
  15. */
  16. constructor(name, exposes, shareScope) {
  17. super();
  18. this.name = name;
  19. this.exposes = exposes;
  20. this.shareScope = shareScope;
  21. }
  22. /**
  23. * @returns {string | null} an identifier to merge equal requests
  24. */
  25. getResourceIdentifier() {
  26. return `container-entry-${this.name}`;
  27. }
  28. get type() {
  29. return "container entry";
  30. }
  31. get category() {
  32. return "esm";
  33. }
  34. }
  35. makeSerializable(
  36. ContainerEntryDependency,
  37. "webpack/lib/container/ContainerEntryDependency"
  38. );
  39. module.exports = ContainerEntryDependency;