webpack/lib/dependencies/DllEntryDependency.js

62 lines
1.3 KiB
JavaScript
Raw Normal View History

2015-05-17 00:27:59 +08:00
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
2018-07-30 23:08:51 +08:00
"use strict";
2018-07-30 23:08:51 +08:00
const Dependency = require("../Dependency");
const makeSerializable = require("../util/makeSerializable");
2015-05-17 00:27:59 +08:00
2023-04-12 03:22:51 +08:00
/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
2023-06-17 02:24:34 +08:00
/** @typedef {import("./EntryDependency")} EntryDependency */
2023-04-12 03:22:51 +08:00
class DllEntryDependency extends Dependency {
2023-06-17 02:24:34 +08:00
/**
* @param {EntryDependency[]} dependencies dependencies
* @param {string} name name
*/
constructor(dependencies, name) {
super();
this.dependencies = dependencies;
this.name = name;
}
get type() {
return "dll entry";
}
2023-04-12 03:22:51 +08:00
/**
* @param {ObjectSerializerContext} context context
*/
serialize(context) {
const { write } = context;
write(this.dependencies);
write(this.name);
super.serialize(context);
}
2023-04-12 03:22:51 +08:00
/**
* @param {ObjectDeserializerContext} context context
*/
deserialize(context) {
const { read } = context;
this.dependencies = read();
this.name = read();
super.deserialize(context);
}
2015-05-17 00:27:59 +08:00
}
makeSerializable(
DllEntryDependency,
"webpack/lib/dependencies/DllEntryDependency"
);
module.exports = DllEntryDependency;