ContainerEntryDependency.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. * @param {string} name entry name
  12. * @param {ExposesList} exposes list of exposed modules
  13. * @param {string} shareScope name of the share scope
  14. */
  15. constructor(name, exposes, shareScope) {
  16. super();
  17. /** @type {string} */
  18. this.name = name;
  19. /** @type {ExposesList} */
  20. this.exposes = exposes;
  21. /** @type {string} */
  22. this.shareScope = shareScope;
  23. }
  24. /**
  25. * @returns {string | null} an identifier to merge equal requests
  26. */
  27. getResourceIdentifier() {
  28. return `container-entry-${this.name}`;
  29. }
  30. get type() {
  31. return "container entry";
  32. }
  33. get category() {
  34. return "esm";
  35. }
  36. }
  37. makeSerializable(
  38. ContainerEntryDependency,
  39. "webpack/lib/container/ContainerEntryDependency"
  40. );
  41. module.exports = ContainerEntryDependency;