2020-02-26 07:30:34 +08:00
|
|
|
/*
|
|
|
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
|
|
Author Tobias Koppers @sokra, Zackary Jackson @ScriptedAlchemy, Marais Rossouw @maraisr
|
|
|
|
*/
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
2020-05-05 16:43:18 +08:00
|
|
|
const Dependency = require("../Dependency");
|
2020-02-26 07:30:34 +08:00
|
|
|
const makeSerializable = require("../util/makeSerializable");
|
|
|
|
|
2020-05-14 21:50:35 +08:00
|
|
|
/** @typedef {import("./ContainerEntryModule").ExposeOptions} ExposeOptions */
|
|
|
|
|
2020-05-05 16:43:18 +08:00
|
|
|
class ContainerEntryDependency extends Dependency {
|
2020-02-27 01:29:24 +08:00
|
|
|
/**
|
2020-05-05 16:43:18 +08:00
|
|
|
* @param {string} name entry name
|
2020-05-14 21:50:35 +08:00
|
|
|
* @param {[string, ExposeOptions][]} exposes list of exposed modules
|
2020-05-26 23:11:21 +08:00
|
|
|
* @param {string} shareScope name of the share scope
|
2020-02-27 01:29:24 +08:00
|
|
|
*/
|
2020-05-26 23:11:21 +08:00
|
|
|
constructor(name, exposes, shareScope) {
|
2020-05-05 16:43:18 +08:00
|
|
|
super();
|
|
|
|
this.name = name;
|
2020-02-26 07:30:34 +08:00
|
|
|
this.exposes = exposes;
|
2020-05-26 23:11:21 +08:00
|
|
|
this.shareScope = shareScope;
|
2020-02-26 07:30:34 +08:00
|
|
|
this.optional = true;
|
|
|
|
}
|
2020-02-27 06:27:56 +08:00
|
|
|
|
2020-05-05 16:43:18 +08:00
|
|
|
/**
|
|
|
|
* @returns {string | null} an identifier to merge equal requests
|
|
|
|
*/
|
|
|
|
getResourceIdentifier() {
|
|
|
|
return `container-entry-${this.name}`;
|
|
|
|
}
|
|
|
|
|
2020-02-27 06:27:56 +08:00
|
|
|
get type() {
|
|
|
|
return "container entry";
|
|
|
|
}
|
2020-02-26 07:30:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
makeSerializable(
|
|
|
|
ContainerEntryDependency,
|
|
|
|
"webpack/lib/container/ContainerEntryDependency"
|
|
|
|
);
|
|
|
|
|
|
|
|
module.exports = ContainerEntryDependency;
|