On this page

  • {ModuleDependency}
new HarmonyImportDependency(request, sourceOrder, phase?, attributes?): HarmonyImportDependency
Attributes
request:<string>
request string
sourceOrder:<number>
source order
phase:
{0|1|2} import phase
attributes:
{ImportAttributes} import attributes
Returns:
{HarmonyImportDependency}
  • attributes {ImportAttributes}
  • category <string>
  • disconnect <any>
  • loc {DependencyLocation}
  • module <any>
  • optional <boolean>
  • phase {ImportPhaseType}
  • range {Tuple<number, number>}
  • request <string>
  • sourceOrder <number>
  • type <string>
  • userRequest <string>
  • weak <boolean>
  • ExportPresenceModes <object>
  • EXPORTS_OBJECT_REFERENCED {string[][]}
  • getNonOptionalPart <object> Get the non-optional leading part of a member chain.
  • NO_EXPORTS_REFERENCED {string[][]}
  • Template {HarmonyImportDependencyTemplate}
  • TRANSITIVE <symbol>
webpack.dependencies.HarmonyImportDependency.couldAffectReferencingModule(): boolean | symbol
true, when changes to the referenced module could affect the referencing module; TRANSITIVE, when changes to the referenced module could affect referencing modules of the referencing module

webpack.dependencies.HarmonyImportDependency.createIgnoredModule(context): Module
Attributes
context:<string>
context directory
Returns:
{Module} ignored module

webpack.dependencies.HarmonyImportDependency.deserialize(__namedParameters): void
  • __namedParameters {ObjectDeserializerContext} context
  • Returns: {void}

webpack.dependencies.HarmonyImportDependency.getCondition(moduleGraph): void
  • moduleGraph {ModuleGraph} module graph
  • Returns: <object> function to determine if the connection is active

webpack.dependencies.HarmonyImportDependency.getContext(): string
Returns:<string>
a request context

webpack.dependencies.HarmonyImportDependency.getErrors(moduleGraph): void
  • moduleGraph {ModuleGraph}
  • Returns: {WebpackError[]}

Returns errors


webpack.dependencies.HarmonyImportDependency.getExports(moduleGraph): void
  • moduleGraph {ModuleGraph}
  • Returns: {ExportsSpec}

Returns the exported names


webpack.dependencies.HarmonyImportDependency.getImportStatement(update, __namedParameters): Tuple<string, string>
Attributes
update:<boolean>
create new variables or update existing one
__namedParameters:
{DependencyTemplateContext}
Returns:
{Tuple<string, string>} the import statement and the compat statement

webpack.dependencies.HarmonyImportDependency.getImportVar(moduleGraph): void
  • moduleGraph {ModuleGraph} the module graph
  • Returns: <string> name of the variable for the import

webpack.dependencies.HarmonyImportDependency.getLinkingErrors(moduleGraph, ids, additionalMessage): void
  • moduleGraph {ModuleGraph} module graph
  • ids <string[]> imported ids
  • additionalMessage <string> extra info included in the error message
  • Returns: {WebpackError[]} errors

webpack.dependencies.HarmonyImportDependency.getModuleEvaluationSideEffectsState(moduleGraph): void
  • moduleGraph {ModuleGraph} the module graph
  • Returns: {ConnectionState} how this dependency connects the module to referencing modules

webpack.dependencies.HarmonyImportDependency.getModuleExports(__namedParameters): void
  • __namedParameters {DependencyTemplateContext} the template context
  • Returns: <string> the expression

webpack.dependencies.HarmonyImportDependency.getNumberOfIdOccurrences(): number
Returns:<number>

implement this method to allow the occurrence order plugin to count correctly


webpack.dependencies.HarmonyImportDependency.getReference(moduleGraph): void
Stability: 0Deprecated
  • moduleGraph {ModuleGraph}
  • Returns: {never}

Returns the referenced module and export


webpack.dependencies.HarmonyImportDependency.getReferencedExports(moduleGraph, runtime): void
  • moduleGraph {ModuleGraph} module graph
  • runtime {RuntimeSpec} the runtime for which the module is analysed
  • Returns: <string[]> referenced exports

Returns list of exports referenced by this dependency


webpack.dependencies.HarmonyImportDependency.getResourceIdentifier(): string
Returns:<string>
an identifier to merge equal requests

webpack.dependencies.HarmonyImportDependency.getWarnings(moduleGraph): void
  • moduleGraph {ModuleGraph}
  • Returns: {WebpackError[]}

Returns warnings


webpack.dependencies.HarmonyImportDependency.serialize(__namedParameters): void
  • __namedParameters {ObjectSerializerContext} context
  • Returns: {void}

webpack.dependencies.HarmonyImportDependency.setLoc(startLine, startColumn, endLine, endColumn): void
Attributes
startLine:<number>
start line
startColumn:<number>
start column
endLine:<number>
end line
endColumn:<number>
end column
Returns:
{void}

webpack.dependencies.HarmonyImportDependency.updateHash(hash, context): void
  • hash {Hash}
  • context {UpdateHashContextDependency}
  • Returns: {void}

Update the hash


webpack.dependencies.HarmonyImportDependency.isLowPriorityDependency(dependency): void
  • dependency {Dependency} dep
  • Returns: <boolean> true if the dependency is a low priority dependency