1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- "use strict";
- const Dependency = require("../Dependency");
- const makeSerializable = require("../util/makeSerializable");
- class ProvideSharedDependency extends Dependency {
-
- constructor(shareScope, name, version, request, eager) {
- super();
- this.shareScope = shareScope;
- this.name = name;
- this.version = version;
- this.request = request;
- this.eager = eager;
- }
- get type() {
- return "provide shared module";
- }
-
- getResourceIdentifier() {
- return `provide module (${this.shareScope}) ${this.request} as ${
- this.name
- } @ ${this.version}${this.eager ? " (eager)" : ""}`;
- }
-
- serialize(context) {
- context.write(this.shareScope);
- context.write(this.name);
- context.write(this.request);
- context.write(this.version);
- context.write(this.eager);
- super.serialize(context);
- }
-
- static deserialize(context) {
- const { read } = context;
- const obj = new ProvideSharedDependency(
- read(),
- read(),
- read(),
- read(),
- read()
- );
- this.shareScope = context.read();
- obj.deserialize(context);
- return obj;
- }
- }
- makeSerializable(
- ProvideSharedDependency,
- "webpack/lib/sharing/ProvideSharedDependency"
- );
- module.exports = ProvideSharedDependency;
|