WXL
4 天以前 2cc85c64f1c64a2dbaeae276a3e2ca8420de76b7
node_modules/webpack/lib/dependencies/ExternalModuleInitFragmentDependency.js
@@ -14,13 +14,15 @@
/** @typedef {import("../Dependency")} Dependency */
/** @typedef {import("../DependencyTemplate").DependencyTemplateContext} DependencyTemplateContext */
/** @typedef {import("../javascript/JavascriptParser").Range} Range */
/** @typedef {import("../dependencies/ExternalModuleInitFragment").ArrayImportSpecifiers} ArrayImportSpecifiers */
/** @typedef {import("../serialization/ObjectMiddleware").ObjectDeserializerContext} ObjectDeserializerContext */
/** @typedef {import("../serialization/ObjectMiddleware").ObjectSerializerContext} ObjectSerializerContext */
class ExternalModuleInitFragmentDependency extends NullDependency {
   /**
    * Creates an instance of ExternalModuleInitFragmentDependency.
    * @param {string} module module
    * @param {{ name: string, value: string }[]} importSpecifiers import specifiers
    * @param {ArrayImportSpecifiers} importSpecifiers import specifiers
    * @param {string | undefined} defaultImport default import
    */
   constructor(module, importSpecifiers, defaultImport) {
@@ -31,15 +33,7 @@
   }
   /**
    * @returns {string} hash update
    */
   _createHashUpdate() {
      return `${this.importedModule}${JSON.stringify(this.specifiers)}${
         this.default || "null"
      }`;
   }
   /**
    * Serializes this instance into the provided serializer context.
    * @param {ObjectSerializerContext} context context
    */
   serialize(context) {
@@ -50,6 +44,7 @@
   }
   /**
    * Restores this instance from the provided deserializer context.
    * @param {ObjectDeserializerContext} context context
    */
   deserialize(context) {
@@ -69,6 +64,7 @@
   DependencyTemplate
) {
   /**
    * Applies the plugin by registering its hooks on the compiler.
    * @param {Dependency} dependency the dependency for which the template should be applied
    * @param {ReplaceSource} source the current replace source which can be modified
    * @param {DependencyTemplateContext} templateContext the context object