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";
|
|
|
|
|
|
|
|
const ModuleDependency = require("../dependencies/ModuleDependency");
|
|
|
|
const makeSerializable = require("../util/makeSerializable");
|
|
|
|
|
|
|
|
class ContainerExposedDependency extends ModuleDependency {
|
2020-02-27 01:29:24 +08:00
|
|
|
constructor(exposedName, request) {
|
2020-02-26 07:30:34 +08:00
|
|
|
super(request);
|
2020-02-27 01:29:24 +08:00
|
|
|
this.exposedName = exposedName;
|
2020-02-26 07:30:34 +08:00
|
|
|
}
|
|
|
|
|
2020-02-27 06:27:56 +08:00
|
|
|
get type() {
|
|
|
|
return "container exposed";
|
|
|
|
}
|
|
|
|
|
2020-02-26 07:30:34 +08:00
|
|
|
/**
|
|
|
|
* @returns {string | null} an identifier to merge equal requests
|
|
|
|
*/
|
|
|
|
getResourceIdentifier() {
|
2020-02-27 01:29:24 +08:00
|
|
|
return `exposed dependency ${this.exposedName}`;
|
|
|
|
}
|
|
|
|
|
|
|
|
serialize(context) {
|
|
|
|
context.write(this.exposedName);
|
|
|
|
super.serialize(context);
|
|
|
|
}
|
|
|
|
|
|
|
|
deserialize(context) {
|
|
|
|
this.exposedName = context.read();
|
|
|
|
super.deserialize(context);
|
2020-02-26 07:30:34 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
makeSerializable(
|
|
|
|
ContainerExposedDependency,
|
|
|
|
"webpack/lib/container/ContainerExposedDependency"
|
|
|
|
);
|
|
|
|
|
|
|
|
module.exports = ContainerExposedDependency;
|