On this page

Attributes
new HarmonyImportDependency(request, sourceOrder, phase?, attributes?): HarmonyImportDependency
Attributes
request:<string>
request string
sourceOrder:<number>
source order
phase:
{0|2|1} import phase
attributes:
{Record<string, string>} import attributes
  • attributes {Record<string, string>}
  • 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>
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

createIgnoredModule(context): Module
Attributes
context:<string>
context directory
Returns:<Module>
ignored module

deserialize(__namedParameters): void
Attributes
__namedParameters:<ObjectDeserializerContext>
context
Returns:
{void}

getCondition(moduleGraph): object | null
Attributes
moduleGraph:<ModuleGraph>
module graph
Returns:<object> | <null>
function to determine if the connection is active

getContext(): string | undefined
a request context

getErrors(moduleGraph): WebpackError[] | null | undefined
Attributes
moduleGraph:<ModuleGraph>

Returns errors


getExports(moduleGraph): undefined
Attributes
moduleGraph:<ModuleGraph>
Returns:<undefined>

Returns the exported names


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

getImportVar(moduleGraph): string
Attributes
moduleGraph:<ModuleGraph>
the module graph
Returns:<string>
name of the variable for the import

getLinkingErrors(moduleGraph, ids, additionalMessage): WebpackError[] | undefined
Attributes
moduleGraph:<ModuleGraph>
module graph
imported ids
additionalMessage:<string>
extra info included in the error message

getModuleEvaluationSideEffectsState(moduleGraph): ConnectionState
Attributes
moduleGraph:<ModuleGraph>
the module graph
Returns:
{ConnectionState} how this dependency connects the module to referencing modules

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

getNumberOfIdOccurrences(): number
Returns:<number>

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


getReference(moduleGraph): never
Stability: 0Deprecated
Attributes
moduleGraph:<ModuleGraph>
Returns:
{never}

Returns the referenced module and export


getReferencedExports(moduleGraph, runtime): string[]
Attributes
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


getResourceIdentifier(): string | null
Returns:<string> | <null>
an identifier to merge equal requests

getWarnings(moduleGraph): WebpackError[] | null | undefined
Attributes
moduleGraph:<ModuleGraph>

Returns warnings


serialize(__namedParameters): void
Attributes
__namedParameters:<ObjectSerializerContext>
context
Returns:
{void}

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}

updateHash(hash, context): void
  • hash {Hash}
  • context {UpdateHashContextDependency}
  • Returns: {void}

Update the hash


Attributes
dependency:<Dependency>
dep
Returns:<boolean>
true if the dependency is a low priority dependency