On this page

Attributes
new HarmonyImportDependency(request, sourceOrder, phase?, attributes?): HarmonyImportDependency
Attributes
request:<string>
sourceOrder:<number>
phase:
{0|2|1}
attributes:
{Record<string, string>}

Creates an instance of HarmonyImportDependency.

  • attributes {Record<string, string>}
  • category <string> Returns a dependency category, typical categories are "commonjs", "amd", "esm".
  • disconnect <any>
  • loc {DependencyLocation} Returns location.
  • module <any>
  • optional <boolean>
  • phase {ImportPhaseType}
  • range {Tuple<number, number>}
  • request <string>
  • sourceOrder <number>
  • type <string> Returns a display name for the type of dependency.
  • userRequest <string>
  • weak <boolean>
  • ExportPresenceModes <object>
  • EXPORTS_OBJECT_REFERENCED {string[][]}
  • getNonOptionalPart <object>
  • NO_EXPORTS_REFERENCED {string[][]}
  • Template {HarmonyImportDependencyTemplate}
  • TRANSITIVE <symbol>
canConcatenate(): boolean
Returns:<boolean>

Returns true if this dependency can be concatenated


couldAffectReferencingModule(): boolean | symbol

Could affect referencing module.


createIgnoredModule(context): Module
Attributes
context:<string>
Returns:<Module>

Creates an ignored module.


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

Restores this instance from the provided deserializer context.


getCondition(moduleGraph): object | null
Attributes
moduleGraph:<ModuleGraph>
Returns:<object> | <null>

Returns function to determine if the connection is active.


getContext(): string | undefined

Returns 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>
__namedParameters:
{DependencyTemplateContext}
Returns:
{Tuple<string, string>}

Gets import statement.


getImportVar(moduleGraph): string
Attributes
moduleGraph:<ModuleGraph>
Returns:<string>

Returns name of the variable for the import.


getLinkingErrors(moduleGraph, ids, additionalMessage): WebpackError[] | undefined
Attributes
moduleGraph:<ModuleGraph>
additionalMessage:<string>

Gets linking errors.


getModuleEvaluationSideEffectsState(moduleGraph): ConnectionState
Attributes
moduleGraph:<ModuleGraph>
Returns:
{ConnectionState}

Gets module evaluation side effects state.


getModuleExports(__namedParameters): void
  • __namedParameters {DependencyTemplateContext}
  • Returns: <string>

Gets module exports.


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>
runtime:
{RuntimeSpec}
Returns:<string[]>

Returns list of exports referenced by this dependency


getResourceIdentifier(): string | null
Returns:<string> | <null>

Returns an identifier to merge equal requests.


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

Returns warnings.


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

Serializes this instance into the provided serializer context.


setLoc(startLine, startColumn, endLine, endColumn): void
Attributes
startLine:<number>
startColumn:<number>
endLine:<number>
endColumn:<number>
Returns:
{void}

Updates loc using the provided start line.


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

Updates the hash with the data contributed by this instance.


Attributes
dependency:<Dependency>
Returns:<boolean>

Returns true if the dependency can be concatenated (scope hoisting).


Attributes
dependency:<Dependency>
Returns:<boolean>

Returns true if the dependency is a low priority dependency.