ContainerEntryDependency.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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").ExposesList} ExposesList */
  9. class ContainerEntryDependency extends Dependency {
  10. /**
  11. * Creates an instance of ContainerEntryDependency.
  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. /** @type {string} */
  19. this.name = name;
  20. /** @type {ExposesList} */
  21. this.exposes = exposes;
  22. /** @type {string} */
  23. this.shareScope = shareScope;
  24. }
  25. /**
  26. * Returns an identifier to merge equal requests.
  27. * @returns {string | null} an identifier to merge equal requests
  28. */
  29. getResourceIdentifier() {
  30. return `container-entry-${this.name}`;
  31. }
  32. get type() {
  33. return "container entry";
  34. }
  35. get category() {
  36. return "esm";
  37. }
  38. }
  39. makeSerializable(
  40. ContainerEntryDependency,
  41. "webpack/lib/container/ContainerEntryDependency"
  42. );
  43. module.exports = ContainerEntryDependency;