ContainerEntryDependency.js 1.1 KB

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