WXL
3 天以前 9bce51f651aad297ef9eb6df832bfdaf1de05d84
node_modules/webpack/lib/dependencies/ExternalModuleDependency.js
@@ -13,17 +13,20 @@
/** @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 ExternalModuleDependency extends CachedConstDependency {
   /**
    * Creates an instance of ExternalModuleDependency.
    * @param {string} module module
    * @param {{ name: string, value: string }[]} importSpecifiers import specifiers
    * @param {ArrayImportSpecifiers} importSpecifiers import specifiers
    * @param {string | undefined} defaultImport default import
    * @param {string} expression expression
    * @param {Range} range range
    * @param {Range | null} range range
    * @param {string} identifier identifier
    * @param {number=} place place where we inject the expression
    */
   constructor(
      module,
@@ -31,9 +34,10 @@
      defaultImport,
      expression,
      range,
      identifier
      identifier,
      place = CachedConstDependency.PLACE_MODULE
   ) {
      super(expression, range, identifier);
      super(expression, range, identifier, place);
      this.importedModule = module;
      this.specifiers = importSpecifiers;
@@ -41,6 +45,7 @@
   }
   /**
    * Create hash update.
    * @returns {string} hash update
    */
   _createHashUpdate() {
@@ -50,6 +55,7 @@
   }
   /**
    * Serializes this instance into the provided serializer context.
    * @param {ObjectSerializerContext} context context
    */
   serialize(context) {
@@ -61,6 +67,7 @@
   }
   /**
    * Restores this instance from the provided deserializer context.
    * @param {ObjectDeserializerContext} context context
    */
   deserialize(context) {
@@ -81,6 +88,7 @@
   CachedConstDependency.Template
) {
   /**
    * 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